[Javascript] Selecting a form element

Terry Riegel riegel at clearimageonline.com
Wed Oct 4 10:21:38 CDT 2006


> Terry Riegel wrote:
>> If I have a form element like
>> <input type="text" name="mydata">
>> Is there a way to select it in a similar manner to getElemntById()?
>
> var nameArray = document.getElementsByTagName('mydata');


I can' seem to get getElementsByTagName working. I am not sure what I  
am doing wrong. You can see my failing example at.

http://clearimageonline.com/projects/prototype.js/inputfinder.html

as an aside: I am also slowly learning to code unobtrusive  
javascript. Thanks to Paul and others for helping me see the light.



Terry



More information about the Javascript mailing list