Keyword "this" Inside If statement In Event
<p>I have <code>onkeypress</code> event and I want to manipulate element <code>this</code>. I also have <code>if</code> statement in the event function. The problem is that the keyword <code>this</code> is different inside the <code>if</code> statement block. Is it normal to be like this. What explanation do you have?</p>

<p>example:</p>

<pre><code>$(o).find('input[name=numeric]').keypress(
    function (e) {
        var a = this; // the real object element which activate the trigger
        if (e.keyCode == 13) {
            var b = this; //here "this" is different object 
        }
        else
            window.ncb.helper.validator.numeric(e);
    }
);
</code></pre>