How to select element with ID generated dynamically?
My code has a repeater / cloning field that adds number to the end of ID : -
- <input type="text" name="event[]" id="event">
That is, when cloned, I'll get the following in the DOM ;
- <input type="text" name="event[]" id="event1">
- <input type="text" name="event[]" id="event2">
My jQuery selector works only on the original element with ID="event"
-
$("#event").stepper({ ....
I'm looking for the right way to make jQuery select event1, event2 and so on; as soon as they are created in the DOM. Would really appreciate if someone can help. Thanks!