<metacharset= "UTF-8" >
<title> Click button to make div color </title>
<style>
div{
border:1px solid white;
width:200px;
height:200px;
Background-color: #7f7f7f;
}
</style>
<body>
<divid= "One" ></div>
<inputtype= "button" value= "Red" id= "Scarlet" >
<inputtype= "button" value= "Orange" id= "Tangerine" >
<inputtype= "button" value= "yellow" id= "yellow" >
"button" value= "green" id= "<inputtype=" >
<inputtype= "button" value= "Blue" id= "Blues" >
<inputtype= "button" value= "Indigo" id= "Indigo" >
<inputtype= "button" value= "purple" id= "Purple" >
<script>
var one =document.getelementbyid ("one");
var Red=decoment.getelementbyid ("Red");
var Orange=decoment.getelementbyid ("Orange");
var Yellow=decoment.getelementbyid ("Yellow");
var Green=decoment.getelementbyid ("green");
var Blue=decoment.getelementbyid ("Blue");
var Indigo=decoment.getelementbyid ("Indigo");
var Purple=decoment.getelementbyid ("Purple");
Red.onclick=function () {
One.style= "background-color:red";
};
Orange.onclick=function () {
One.style= "Background-color:orange";
};
Yellow.onclick=function () {
One.style= "Background-color:yellow";
};
Green.onclick=function () {
One.style= "Background-color:green";
};
Blue.onclick=function () {
One.style= "Background-color:blue";
};
Indigo.onclick=function () {
One.style= "Background-color:indigo";
};
Purple.onclick=function () {
One.style= "Background-color:purple";
};
</script>
</body>