Javascript examples for CSS Style Property:color
Get the text-color of a <p> element:
<!DOCTYPE html> <html> <body> <p id="myP" style="color:red;">This is an example paragraph.</p> <button type="button" onclick="myFunction()">Return text color of p</button> <script> function myFunction() {/*from w w w . j a va 2s. c om*/ console.log(document.getElementById("myP").style.color); } </script> </body> </html>