pallavidestiny22 pallavidestiny22 - 1 month ago 17
Javascript Question

Debugging not showing the proper result

I am trying to learn the javascript debugging and I am followint the article here[linke here][1]

[1]: http://meeech.amihod.com/getting-started-with-javascript-debugging-in-chrome/ I was able to follow along the tutorial.My code is

<script>
var value="hang";
function test(){
setInterval(function(){
switch(value){
case'hang':
document.body.innerHtml="Hang in there";
break;
case'up':
document.body.innerHTML="Up";
break;
default:
document.body.innerHTML="No good!";
}
},1000);
};

</script>


Ater inspecting in debugger,it shows that it reached to
document.body.innerHtml="Hang in there";
But my html page isnot showing the output Hang in there
Though it may seem simple question, I am not getting into it. Please help.
Also I cannot find Add to watch option on right click as stated in tutorial.

Answer

JS property names like innerHTML are case-sensitive. Try changing it to ….innerHTML="Hang in there".

Comments