<! DOCTYPE html>{padding:0px; margin:0px; } #div-color{Background-color: #ffff00; width:100px; height:100px; }. mid{width:900px; Margin:auto; }. center{width:300px; height:300px; Margin:auto; BORDER:1PX solid black; }. divmid{padding:30px; } #div1 input{width:50px; height:30px; } </style>class= "Mid Center" style= "Display:none" > <div id= "Div1"class= "Divmid" > <input type= "button" value= "green" id= "green" style= "Background-color:green" onclick= "Change (' gr Een ', null,null) "/> <input type=" button "value=" Red "id=" Red "style=" background-color:red "onclick=" change (' Red ') "/> <input type=" button "value=" Blue "id=" Blue "style=" Background-color:blue "onclick=" Change (' Blu E ') "/> </div> <div id=" Div2 "class= "Divmid" > <span> width px:</span> <input type= "button" value= "$" id= "width1" onclick = "Change (null, ' 200px ')"/> <input type= "button" value= "id=" width2 "onclick=" Change (null, ' 300px ') "/> ; <input type= "button" value= "id=" Width3 "onclick=" Change (null, ' 400px ') "/> </div> <div id= "Div3"class= "Divmid" > <span> height width px:</span> <input type= "button" value= "$" id= "height1" Oncl ick= "Change (null,null, ' 200px ')"/> <input type= "button" value= "" id= "height2" onclick= "Change (null,null , ' 300px ') "/> <input type=" button "value=" "id=" Height3 "onclick=" Change (null,null, ' 400px ') "/> </div> </div></body><script>document.getElementById ("Btn-setcolor"). onclick=Showorhide; VAR flag=true; function Showorhide () {if(flag) {document.getElementById ("Mid"). Style.display = ' block '; document.getElementById ("Btn-setcolor"). Value = "Hide Palette"; Flag=false; } Else{document.getElementById ("Mid"). Style.display = ' None '; document.getElementById ("Btn-setcolor"). Value = "Set Palette"; Flag=true; }} function Change (colornew,widthnew,heightnew) {var divcolor=document.getelementbyid ("Div-color"); if(colornew!=NULL|| colornew!=undefined) {Divcolor.style.backgroundColor=colornew; } if(widthnew!=NULL|| widthnew!=undefined) {Divcolor.style.width=widthnew; } if(heightnew!=NULL|| heightnew!=undefined) {Divcolor.style.height=heightnew; } }</script>Set the height of the div's color width by color palette