Cannot find previous inserted element in jquery ready()
<p>My code doesn't work, it seems the previous inserted element cannot be found by later script. </p>

<p>i updated basic syntax errors as the first three answners, but it seems still doesn't work.</p>

<p>code :</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
&lt;script src="http://code.jquery.com/jquery-migrate-1.1.1.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt; 
$(document).ready( function() {
     $('#menu').html('&lt;a href="page4.html" class="dynamicLoad"&gt;ddd&lt;/a&gt;');
 });  

$(document).ready( function() {
        $( 'a.dynamicLoad' ).click( function( e ) {
            e.preventDefault();   // prevent the browser from following the link
            e.stopPropagation();  // prevent the browser from following the link
            $( '#myDiv' ).load( $( this ).attr( 'href' ) );
        });
});
&lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;


&lt;div id="menu"&gt;mymenu&lt;/div&gt;
&lt;div id="myDiv"&gt;aaaaaaaaaaaa&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
