<html>
<head>
<style>
#myDIV {
position: absolute;
width: 100px;
height: 100px;
background-color: coral;
}
</style>
</head>
<body>
<h1>Change color with JavaScript</h1>
<p>Click the "Try it" button to set the text-color of the DIV element to "lightblue":</p>
<button onclick="myFunction()">Try it</button>
<div id="myDIV">
<h1>myDIV</h1>
</div>
<script>
function myFunction() {
document.getElementById("myDIV").style.color = "lightblue";
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/cssref/tryit.asp?filename=trycss_js_color by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:00:45 GMT -->
</html>