Pablo De Luca
Pablo De Luca

Reputation: 823

Jquery selector for an input with a specific name and inside a specific form

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

Answers (1)

Akshay Arora
Akshay Arora

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

Related Questions