So here is my code:
$(document).ready( function() {
$('#form').bind('change', function(){
$.ajax({
type: 'get',
url: 'api.php',
data: 'task=getdirs&formname='+$('#form').attr('value'),
dataType: "text",
success: function (html){
$('#chdir').html(html);
$('#chdir select').bind('change', getDirs());
}
});
});
function getDirs(){
}})
#form
here a select element, the ajax call returns me a peace of html with new select element.
It works nice: in the #chdir
div I get new dropdown element. But there also event inside success fires one time. Then this event not working at all.
What can I do to make new created select working the same way as first?