I am trying to automatically get the content in #mydiv when I load a page. Since the content is dynamically, so I just use .on(). It works when I click the #mydiv.
But can it work without clicking the #mydiv? It will be nice if it loads automatically.
$( "#mydiv" ).on( "click", function() {
alert( $( this ).text() );
});
I have tried "load", but didn't get any luck...