It’s weird but I found all article not working for me. I have ids in my forms like formup_1, formup_2 generated by PHP scripts. Now I’m not able to select a particular id. How can I do that. Do I have to use live for binding event?
I tried to do it like this:
var vvv=$("form[id^='rating_formup_']");
<form id="rating_formup_1">
<input type="submit" name="n" value="">
</form>
<form id="rating_formup_2">
<input type="submit" name="n" value="">
</form>
.
.
.
It will select all the
<form>elements that theiridstarts withformupYou can also use:
Which might be a little bit faster.
If you do that and it’s still not working:
<form>are created on the fly, make sure you query the DOM after they are inserted to the DOM.