For example, I ran into some code today that set the value of a text input in a form:
That’s pretty easy and intuitive, but it only works in IE. Want to get it to work elsewhere? Here’s the updated code:
whoa Notice two things:
- getElementsByName is plural, getElementByName does not work.
- Because you must use the plural, an array is returned and you have to reference the first value in the array by using