jQuery quick question about event handling.
Here's simple code
<div id="txt">change me!</div>
$('#txt').click(function () {
console.log(this);
$(this).text('changed!');
});
this outputs
<div id="txt">changed!</div>
in console. Though console.log(this)
is executed before text()
method, I get result of text()
method is fired. Why is that?