In: Computer Science
/* Complete the TO DO comments below */
window.onload = function() {
/* TODO add a border to the header of the page
(a) a simple type selector, and
(b) the style property of the element object. */
document.querySelector('TODO').TODO = TODO;
/* TODO change the text of the h1 element by using
(a) the first-child pseudo selector, and
(b) the innerHTML property of the element object. */
document.querySelector('TODO').TODO = TODO;
/* TODO change the background-color of the section with id
"inventory"
(a) the id selector, and
(b) the style property of the element object. */
document.querySelector('TODO').TODO = TODO;
/* TODO add more of your own changes below! */
}
Please help me
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
/* Complete the TO DO comments below */
window.onload = function() {
/* TODO add a border to the header of the page
(a) a simple type selector, and
(b) the style property of the element object. */
document.querySelector('header').style = "border:2px solid red";
/* TODO change the text of the h1 element by using
(a) the first-child pseudo selector, and
(b) the innerHTML property of the element object. */
document.querySelector('h1:first-child').innerHTML = " the first-child pseudo selector";
/* TODO change the background-color of the section with id "inventory"
(a) the id selector, and
(b) the style property of the element object. */
document.querySelector('#inventory').style = "background-color:green";
/* TODO add more of your own changes below! */
}
Below is the output :
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.