Get the current field name
<p>I called below function on body and what i want is when i press anything in textbox it will alert me the name of the textbox and i want to check name and than execute something .Checking name is working great in FF and not in IE.Thanks </p>

<pre><code>&lt;body bgcolor="#F2F2F2" OnKeyPress="return getFieldName(event);"&gt;
</code></pre>

<p>...</p>

<pre><code>function getFieldName(e) {
</code></pre>

<p>e = e || window.event;
  var key = e.keyCode || e.which,
      target = e.target || e.srcElement;</p>

<p>This works but target.name is not trappable in IE
for eg:</p>

<p>if(target.name == 'one') {
//we can reach here is FF and Not in IE</p>

<p>}</p>

<p>}</p>
