How to hide my dynamicly created divs?
<p>I have created a script that creates divs based on number of li elements and that part is working fine. Now what I would like to do is to <b>hide these div's</b> (dynamicly created) but it is not working. Can someone tell me what I am doing wrong here? THX!!
<br/><a href="http://jsfiddle.net/utTre/" rel="nofollow">Fiddle here</a></p>

<p>My code:</p>

<pre><code>$(document).ready(function(){
$(".create").click(function(){
i='';
var count = $("li").length;
for(var i=0;i&lt;count;i++){
$('&lt;div class="mydiv" style="width:100px;height:100px;background-color:red;border:1px solid #000000;"&gt;&lt;/div&gt;').appendTo('body');
}
});

$('.check').click(function(){
var getDivs= $('div').length;
alert(getDivs);
});
//Why is this not working?
$('div').click(function(){
$(this).hide();
});
});
</code></pre>
