i tried to change the css style of a division using javascript. here is Css
<style>
#box
{
height:200px;
width:200px;
background:#c0c0c0;
}
</style>
Here is javascript code
<script>
function fun()
{
setInterval(function(){fun1()},3000);
}
function fun1()
{
var x = document.getElementById("box");
x.style.backgroundColor="red";
}
</script>
and within HTML body
<div id="box"></div>
<br>
<button type="button" onClick="fun();">Click here </button>
why isn't the color of the div being changed even after clicking the button?