Javascript examples for CSS Style Property:backgroundColor
Get a background color for a document
<!DOCTYPE html> <html> <body style="background-color:yellow;"> <h1>Hello World!</h1> <button type="button" onclick="myFunction()">Get background color</button> <script> function myFunction() {/*from w w w . j ava 2 s . c om*/ console.log(document.body.style.backgroundColor); } </script> </body> </html>