Aloap
March 2, 2018, 4:26pm
1
Hello everybody! Question for you
I’ve a form with different tag, each in a
tag.
Something like that:
<form id=myForm>
<div><input name="name1"></div>
<div><input name="name2"></div>
<div><input name="name3"></div>
</form>
I’m searching for the Jquery selector of specific input in the form, by name, for a function which have the #id of the form.
I guess something like $(’#id div input[name=name]’)
But it doesn’t work…
Thanks for your help in advance!
That format should work. Maybe you just have a syntax error? Your quote characters look off.
here is a jsbin of it working
ETA: You did remember to import jQuery, right?
Aloap
March 2, 2018, 4:41pm
3
Hi! Thank you for your reply
Yes, I have jquery but I actually have to do something like that:
A live pastebin for HTML, CSS & JavaScript and a range of processors, including SCSS, CoffeeScript, Jade and more...
I receive the #id of the form as a function’s argument and I have to select some inputs of that specific form by name, but I can’t
You just forgot a space before the "div"
in your selector. Add that and your jsbin works
1 Like