jQuery click function doesn't work after ajax call? [duplicate] jQuery click function doesn't work after ajax call? [duplicate] ajax ajax

jQuery click function doesn't work after ajax call? [duplicate]


The problem is that .click only works for elements already on the page.You have to use something like on if you are wiring up future elements

$("#LangTable").on("click",".deletelanguage", function(){  alert("success");});


When you use $('.deletelanguage').click() to register an event handler it adds the handler to only those elements which exists in the dom when the code was executed

you need to use delegation based event handlers here

$(document).on('click', '.deletelanguage', function(){    alert("success");});


$('body').delegate('.deletelanguage','click',function(){    alert("success");});

or

$('body').on('click','.deletelanguage',function(){    alert("success");});