Problem with event handler
<pre><code>function getFieldName(e) { 
  e = e || window.event;
  var key = e.keyCode || e.which,
      target = e.target || e.srcElement;

  alert(target.name);
  return (key != 13);
}
</code></pre>

<p>I have the above function called on body tag <code>onkeypress = getFieldName(event);</code></p>

<p>I get the name of desired field but not able to check in IE as well as FF</p>

<pre><code>if(target.name == 'check') {
    // works fine in FF but in IE I'm not able 
    // to come inside this if-block, please suggest 
}
</code></pre>

<p>thanks</p>
