Question

I have some code where I use the before() method to insert an input-field amongst other things. But for some reason the input-fields created dynamically does not trigger on $("input").focus().

How do I get the new input-fields to trigger on focus()?

Was it helpful?

Solution

For dynamically created tags you should bind the events using delegates, try

$(document).on( "focus", "your input selector", function() {

});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top