javascript function .change() not run on cloned element

i designed a dynamic table which user can add more row. and there is a function .change() on an input for the first row its run, but for next (cloned) elements the function doesn't run

my fiddle is here

the code as follow

$(document).ready(function(){   
$("#btnAddItemAssignee").click(function(e){
    e.preventDefault();         
    $(".oAssignee:last").clone().insertAfter(".oAssignee:last");
    $(".oAssignee:last").find("#txtAssigneeType").val("");
    $(".oAssignee:last").find("#txtAssigneeId").val("");
});
});

$("body #txtAssigneeType").change(function(){
if ($(this).val()=="Individu")
{
    console.log($("body #txtAssigneeType").length);
    alert("call me");       
}
});

Answers 1

Related Articles