Code:
<html>
<head>
<script>
function changeBgColor(){
document.getElementById("bgc").style.background-color=333333;
}
</script>
<style>
#bgc{
width:300px;
height:100px;
background-color:#cccccc;
}
</style>
</head>
<body>
<p id="bgc" onmouseover="changeBgColor()">
Hi There, pls change bg color
</p>
</body>
</html>
I am getting following error
"SCRIPT5007: The value of the property 'changeBgColor' is null or undefined, not a Function object eventTest1.html, line 22 character 29"
This is a simple code, why am I getting such a weird error. Whats wrong in here ?
Thanks