Question: / / 1 / / Select the div with the id of problem - one and change the border color to / / red and

//1
// Select the div with the id of "problem-one" and change the border color to
// red and the border width to 3 pixels
document.getElementById("problem-one").style.border ="3px, solid red";
document.querySelectorAll("problem-one").forEach(element =>{
element.style.boxShadow ="1922px black";
})
//2
// Select the text in the first div that has the class of "even" and change the
// font color to green and the font style to bold
document.querySelector(".even").style.color = "green";
document.querySelector(".even").style.fontWeight = "bold"
//3
// Select all of the elements with the class of "odd" and add a box shadow. You
// may choose your own box-shadow values.
document.querySelectorAll(".odd").forEach(element =>{
element.style.boxShadow ="2px 2px 5px gray";
})
//4
// Select the fourth box with a selector of your choice. Change the text inside
// the box to the string "Four"
document.querySelectorAll(".box")[3].textContent = "Four";
//5
// Select the fifth box. Remove the text "5", and replace it with a child button that says "5!"
let fifthBox = document.querySelectorAll(".box")[4];
fifthBox.textContent =""; // Remove existing text
let button = document.createElement("button");
button.textContent ="5!";
fifthBox.appendChild(button)
//6
// Select the span element. Remove it from the DOM.
let spanElement = document.querySelector("span");
if (spanElement){
spanElement.remove();
}
//7
// Select the element with the number 7, and change the number to 6(because you
// just removed number 6!)
let numberSevenElement = document.querySelector(".box:nth-child(7)");
if (numberSevenElement){
numberSevenElement.textContent ="6";
}
//8
// Select the last box, and add the class of "last". This will apply new styling
// to the box if successful. Change the text inside to box to "END!!!"
let lastBox = document.querySelector(".box:last-child");
if (lastBox){
lastBox.classList.add("last");
lastBox.textContent = "END!!!";
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!