HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <h1 id="point">CSS background-color Property</h1> <button onclick="myFunction()">Click Me</button> <script> function myFunction(){ var x = document.getElementById("point") x.style.backgroundColor = "black"; x.style.color = "white" } </script> <p><strong>Note</strong>: Click on the button to apply background-color</p> </body> </html>
OUTPUT
×

Save as Private