Javascript examples for CSS Style Property:color
Get and set element color via CSS style color
<html> <head></head> <body> <div id="divid" style="color:red;"> Test // w w w. j ava 2 s .c om </div> <script> test(); function test() { var color = document.getElementById("divid").style.color; if(color == "red") { document.getElementById("divid").style.color = "green"; } } </script> </body> </html>