JavaScript: Accessing getElementById in Firefox
A common mistake when using the getElementById function in Firefox is failing to set the id attribute of the element being accessed. This will work in Internet Explorer because it treats the name attribute as the id attribute in the case where the id attribute is not provided. Firefox, however, is not forgiving on this point. The id attribute of an element must be provided in order to access that element via the getElementById function.
Example:
<input type=”text” name=”FirstName” id=”FirstName”>
Related articles:
Accessing Form Elements with JavaScript
Without the id=”FirstName”, this element cannot be accessed by the getElementById function in Firefox.