Javascript examples for DOM HTML Element:Style
The Style object represents an individual style statement.
<!DOCTYPE html> <html> <head> <style> body {/*from w w w. j av a 2 s .c o m*/ background-color: yellow; color: red; } </style> </head> <body> <button onclick="myFunction()">display the style properties</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementsByTagName("STYLE")[0]; document.getElementById("demo").innerHTML = x.innerHTML; } </script> </body> </html>