Monday, 19 August 2013

Why is this one says undefined?

Why is this one says undefined?

<section id="clickme">
<p>Stuff goes here.</p>
</section>
$("#clickme").on("click", function(){
alert(this.innerHTML);
setTimeout(function(){
alert(this.innerHTML);
}, 1000);
})
Does anyone know why the second alert is undefined?

No comments:

Post a Comment