Skip to content

Instantly share code, notes, and snippets.

@chintamanand
Created June 28, 2017 04:44
Show Gist options
  • Save chintamanand/e6647a7865d90f5628f5175db542faf6 to your computer and use it in GitHub Desktop.
Save chintamanand/e6647a7865d90f5628f5175db542faf6 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<p>JavaScript can change the color.</p>
<h5 onmouseover="changecolor1()">red</h5>
<h5 onmouseover="changecolor2()">yellow</h5>
<h5 onmouseover="changecolor3()">blue</h5>
<h5 onmouseover="changecolor4()">orange</h5>
<h5 onmouseover="changecolor5()">pink</h5>
<script>
function changecolor1(){
document.body.style.backgroundColor="red";
}
function changecolor2(){
document.body.style.backgroundColor="yellow";
}
function changecolor3(){
document.body.style.backgroundColor="blue";
}
function changecolor4(){
document.body.style.backgroundColor="orange";
}
function changecolor5(){
document.body.style.backgroundColor="pink";
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment