Javascript examples for CSS Style Property:backgroundColor
Get the background color of a document via body background property
<!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 a v a 2 s . c om console.log(document.body.style.backgroundColor); } </script> </body> </html>