Question: (VsCode) Create a button on an HTML page Give the button an id of background Create a js file called color.js In color.js use a
(VsCode)
- Create a button on an HTML page
- Give the button an id of background
- Create a js file called color.js
- In color.js use a Dom method to locate the button
- assign the located button to a reference variable
- Add an event listener to the button which responds to a click event
- The event listener should call another function on the click event called setBackground color
- the function setBackgoundColor will change the color of the body
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
