In JQuery , how to get the object of 'name' input with selector ? like
$("#myform>name")
<form id='myform'>
<input name='name' type='text' />
</form>
thanks
In JQuery , how to get the object of 'name' input with selector ? like
$("#myform>name")
<form id='myform'>
<input name='name' type='text' />
</form>
thanks
try:
$("#myform > input[name='name']")
or use direct by attribute selector if there is only element with this attribute value combination:
$('input[name="name"]')
This should work.
$('#myform > input[name="name"]')
There are other ways too but this is exactly what you asked
about (it selects all input elements with name name
which
are below myform
in the DOM tree).