Simply put it in $(document).ready();
It will then execute when your document is loaded. Something like this:
$(document).ready(function(){
alert($("#divId").html());
});
Edit (see comment):
$(document).ready(function(){
$('.yourdivclass').each(function() {
alert($(this).html());
});
});