Javascript examples for CSS Style Property:color
Interactive change of background color by typing hex values
<html> <head></head> <body> <input type="text" value="#330000" id="color"> <button id="changeColor">Change Color</button> <script> var button = document.getElementById("changeColor"); button.addEventListener('click', setColor, false); function setColor(){// ww w .j a v a2s. co m var color = document.getElementById("color").value; document.body.style.backgroundColor = color; } </script> </body> </html>