0

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".

2
  • 1
    $('#idreg [name="pass"]') Commented Feb 5, 2016 at 6:14
  • 1
    @PranavCBalan Thanks. It works. Commented Feb 5, 2016 at 6:27

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.