Get comprehensive answers to your questions with the help of IDNLearn.com's community. Ask any question and get a detailed, reliable answer from our community of experts.

Please Use HTML, JAVASCRIPT AND HTML
Color Changer
Create an application with three grey, square divs, in a row. They should be 200px by 200px, and all floated left. Give them a margin of 5px.
Using only one event handler, write event listeners to respond to a click on each element. Each element should change to a different color: one red, one green, and one blue. Use a data attribute on the elements to store the color to be changed to.
The result, after clicking on the first and third, should look something like this:


Sagot :

CSS (Cascading Style Sheets) is a programming language used to style and layout web pages.

How to make a CSS application using JavaScript?

  • We still write all of our CSS in JavaScript, but instead of passing it to the style attribute, we take those styles and inject them into the DOM as an actual string of CSS in a  tag.
  • The Script component. The HTML element  is used to embed executable code or data; it is commonly used to embed or refer to JavaScript code.
  • Events are actions or occurrences that occur in the system you are programming and are reported to you so that your code can react to them.

   <div id="squareOne" class="listener"></div>

   <div id="squareTwo" class="listener"></div>

   <div id="squareThree" class="listener"></div>

{

document.getElementById('squareOne').onclick = change_Color;

function change_Color()

}

#squareOne{

   width: 200px;

   height: 200px;

   margin: 5px;

   background-color: #ccc;

}

#squareTwo{

   width: 200px;

   height: 200px;

   margin: 5px;

   background-color: #ccc;

}

#squareThree{

   width: 200px;

   height: 200px;

   margin: 5px;

To learn more about CSS refer to :

https://brainly.com/question/9066363

#SPJ4