- Webiste Name: Dev To
- Query Selctory, Inner HTML
Target the Top description div and change the DEV Community to <Your_Name> and description to your passion
document.querySelector(".side-bar .crayons-card .crayons-subtitle-2 ").innerHTML = "Rohan Malo"
document.querySelector(".side-bar .crayons-card .color-base-70 ").innerHTML = "building awesome staff with code"
- Website Name: Apple
let arr = []
for (let i = 0; i < 7; i++) {
arr.push(document.querySelectorAll(".as-imagegrid-item-title")[i].innerText.splt("\n")[0])
}
// Using for in loop
['iPhone', 'Mac', 'iPad', 'Watch', 'AirPods', 'Music', 'TV']
- Webiste Name: Youtube Support
- Get Element By Id, Create Element, Create Text Node, Append Child
Add another FAQ 'My New FAQ' to the list
let list = document.querySelector(".article .accordion-homepage")
newEle = document.createElement("section")
newEle.textContent = "New item added by Rohan"
list.append(newEle)
newEle.className = "parent"
- Webiste Name: OnePlus
Query Selector, InnerText
Change the contact number
document.querySelector(".one-tel-number ").innerText = "+91 6289038527"
- Webiste Name: Samsung
getElementById, createElement, InnerText, append, setAttribute
Target the main div of card and change the Button text to Check out
document.querySelector(".diwali-deals-product-sale-btn").innerText = "Check Out"
- Webiste Name: Adidas
- Query Selector, Event listeners, Changing Styles
Target the search box and on hover change thebackground color to red.
let search = document.querySelector(".searchinput___19uW0")
search.addEventListener('mouseover', () => { search.style.background = "red" });
- Webiste Name: MDN Web Docs
Form, Value, Submit
To Search a topic in the MDN Search bar.
First add a text to search in the search bar and then hit the submit search button to search the docs using DOM
let search = document.querySelector('#top-nav-search-input')
search.value = "CSS Selector"
document.querySelector('.search-form').submit()
- Webiste Name: Google
Remove Elements
Remove alternate languages from the home page languages listed
let lang = document.querySelector('#SIvCob').children
for(ele in lang){
if( ele % 2 === 0 ){
lang[ele].remove()
}
}
- Webiste Name: Code Wars
Change Font Family, Color of Text.
Change the font family of the text to monospace and text color to the logo’s background color.
let str = document.querySelector('.display-heading-1')
str.style.fontFamily = "monospace"
str.style.color = "#AB341D"
- Webiste Name: Freecodecamp
querySelector, mouseover, click eventListener, callback function, style,
Target the button and change background colour on mouseover
let str = document.querySelector('.btn-cta-big .login-btn-text')
str.addEventListener("mouseover", () => { str.style.background = "red" } )
- Webiste Name: realme
querySelector,style,background-image
change the realme logo to ineuron logo
document.querySelector('.icon-logo').style.backgroundImage = "url('https://ineuron.ai/images/ineuron-logo.png')"
- Webiste Name: Github
querySelector,style,background-Color
change the background colour of the button to blue.
document.querySelector('.btn').style.background = "blue"
- Webiste Name: Hackerrank
querySelector,innerHtml
Target the top description and change “Matching developers with great companies” to ‘JSBOOTCAMP“.
document.querySelector('.fl-heading-text').innerHTML = "JSBOOTCAMP"
- Webiste Name: Asus
querySelector,style,font-size
change the fontsize of “Hot Deals” to 80px
document.querySelector('.HotDealsAll__Heading__2fIbe').style.fontSize = "80px"
- Webiste Name: Dell
querySelector,style.textAlign
Convert the text “G15 Gaming Laptop” from left to right
document.querySelector('.ps-title a').style.float = "right"
- Webiste Name: Vercel
querySelector,innerHTMl
change the heading “Start with the developer” to “Start with Scratch”
document.querySelector('.section-title_title__VEDfK').innerHTML = "Start with Scratch"
- Webiste Name: Sony
querySelector,innerHTMl
change the button text To current Date.
let date = new Date()
document.querySelector('.btn-container').innerHTML = date
- Webiste Name: Philips
querySelector,style,backgroundcolor
change the background colour blue to orange
document.querySelector('.p-f03-footer-container ').style.background = "#E8BD0D"
- Webiste Name: Canon
querySelector,src
extract the canon logo
document.querySelector('.logo').src
- Webiste Name: Oppo
querySelector,style,color
Change the description colour black to orange
document.querySelector('.desc').style.color = "orange"