How can I delay a function, since the checkboxes are generated dynamically in the conventional way in javascript, and only run after the entire page has been rendered and the other javascripts have been executed?
I'm trying to use this code:
var count = 0;
$('input:checkbox').click(function(){
if( $(this).is(':checked') ){
count++;
}else{
count--;
}
$('#count').html( count );
});
And the one to display in the html:
<p><div id="count">0</div></p>