[Javascript] Dollar function for name=

Terry Riegel riegel at clearimageonline.com
Tue Jun 1 10:06:42 CDT 2010


Hello All,

Is there a method for finding a name="whatever" on a page similar to document.getElementById('whatever')?

For example suppose I have this form...


<form action="go.html" method="post">
 <input type="text" name="myname">
 <input type="text" name="mypass">
 <input type="submit" name="mysubmit" value="Login">
</form>


I would like to target name="myname" in a similar way that I can with getElementById()

Even if it takes a fair bit of code to do it it would be nice to have a 'dollar' type function for this.

When I use the term dollar function I am referring to the fairly ubiquitous convenience function for getElementById() found in the popular javascript library prototype.

Thanks,

Terry Riegel


More information about the Javascript mailing list