HI I am trying to get div from getelementbyid but it isnt working for me this is my code
<body onload="ErrorCheck(-1)">
<script type="text/javascript">
function ErrorCheck(var1)
{
if(var1 = -1)
{ alert("in function");
var cont = document.getElementBId('msg');
if(cont==null){
alert("null");
}
else{
alert("not null");
}
}
}
</script>
<h1 class="header">Register</h1>
<div id="msg"></div>
</body>
after getElementBId is called this function becomes dead as it doesnt go to any if or else. Please check what am i doing wrong here
you forgot y before
...Id('msg');: