Since the class is added dynamically, you need to use event delegation to register the event handler like:
$('#LangTable').on('click', '.deletelanguage', function(event) {
event.preventDefault();
alert("success");
});
This will attach your event to any anchors within the #LangTable element,
reducing the scope of having to check the whole document element tree and increasing efficiency.
No comments:
Post a Comment