0

I have a problem regarding accessing an element id from a jQuery click event when the actual element is part of template rendered with the method renderWith(). I cannot figure out whats wrong and could surely need some wise input.

1 Answers1

0

If your element is rendered (AKA: created dynamically) try like:

$(document).on('click', "#yourElementId", function(){
   alert( this.id ); // Test
});

if that's the case the question is a dupe of Click event doesn't work on dynamically generated elements (Pending Close)

Community
  • 1
  • 1
Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313