I m trying to change color using the onclick event. Like on first click RED color ,then on next click Green color,then on another click again backt o RED color. I have completed the click concept but did not understand how to set color concept using JS. Any simple solution?
<head>
<script>
function getValue() {
var x = document.getElementById("myHeader");
alert(x.innerHTML);
}
</script>
</head>
<body>
<h1 id="myHeader" onclick="getValue()">Click me!</h1>
</body>