Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>HTML Style Object</h1> <h2>The backgroundColor Property</h2> <div id="myDiv" style="background-color:orange;">This is myDiv.</div> <p>The background properties of myDiv is:</p> <p id="demo"></p> <script> let back = document.getElementById("myDiv").style.backgroundColor; document.getElementById("demo").innerHTML = back </script> </body> </html>