Using datatables. It generated following selectbox dynamically with Javascript
Firebug shows this piece of code for select box above

I tried to trigger $('#check_all').click( function() with following simple function. But it doesn't work. What Is there any mistake in code?
$('select[name=list_length]').change(function(){
if($('#check_all').prop('checked'))
$('#check_all').click();
});
$('#check_all').click( function() {
if($(this).prop('checked')){
totalqt=0;
$('.checkbox').each(function(){
$(this).prop('checked', true);
doIt(this);
});
}else{
$('.checkbox').each(function(){
$(this).prop('checked', false);
doIt(this);
});
}
changeQt();
} );
$('#check_all').trigger('click');?if ($('#check_all').is(':checked'))...?live('changed', function () {instead.