Reputation: 823
I want to select an input with a name "pass" which is inside a form with the id "idreg".
The idea is not to use an id in this input (obviously this would simplify what I want to do) and I can't select by the name because I have, in another form, a input with the name "pass".
Upvotes: 0
Views: 580
Reputation: 1945
You are looking for the jQuery attribute equals selector.
It selects the element that have the specified attribute with the given value, exactly.
$('#idreg [name="pass"]')
should work fine.
Upvotes: 1