I have the following input on my page:
<input type="text" name="r1" />
I am trying to select it with JQuery, using $("[name='r1']"), and for some reason it returns null. Ok, fine, the title is misleading in that it is me that is doing something wrong; can you tell me what?
EDIT:
$('input[name="r1"]') doesn’t work either. Also, sorry for the typo.
Last EDIT
Working DEMO
Html Code
Jquery Code
OLD Updates
you have typo error here you are trying to find
r2element which is not there just update code like$("[name='r1']")or
to find it proper way you should do as below
$("input[name='r2']")instead of$("[name='r2']")onlyEDIT
According to you edited question you should check example over here : Attribute Equals Selector [name=”value”]
EDIT
for proper check you can do like this