Access form element through javascript - what's the correct way?
<p>I am developing an asp.net application and i want to make it compatible with all 3 major browsers (Internet Explorer, Firefox, Chrome) at least.</p>

<p>In some pages i need to access the form elements through javascript.
What is the correct way to do this so that it works on all browsers? </p>

<p>I have been doing something like this </p>

<pre><code>document.forms[0].elements["nroErros"].value
</code></pre>

<p>to access my "nroErros" hidden field for instance and even though this works on IE, it doesn't seem to work correctly on Firefox. </p>

<p>So, the question is, what is the correct way to make it work always?</p>
