Possible Duplicate:
Referencing “this” inside setInterval/setTimeout within object prototype methods
The second alert box is saying "undefined"? Why is this?
<a id = "clickme">Click Me!</a>
<script>
var a = document.getElementById("clickme");
a.onclick = function(); {
alert(this.innerHTML);
setTimeout( function() {
alert( this.innerHTML );
}, 1000);
};
</script>