How to make an unique div id?
<p>here is my html markup... the problem is the javascript looping doesnt work... i did some kind of mistakes.. i dont know why... i want to loop $('#opt_art').mouseover etc... and every loop makes the script like this first loop $('#opt_art1).mouseover, second loop $('#opt_art2).mouseover, etc</p>

<pre><code>&lt;?php include('header.php'); ?&gt;
    &lt;script type="text/javascript"&gt;
        $(document).ready(function(){
            var i = 0;
            do{
                var num = i;
                $('#opt_art'+num).mouseover(function(){
                    $('.opsi'+num).show();
                });
                $('#opt_art'+num).mouseout(function(){
                    $('.opsi'+num).fadeOut(2000);
                });
                i++;    
            }
            while(i&lt;=2);
        });
    &lt;/script&gt;
    &lt;?php
        for($i=1;$i&lt;=2;$i++){
    ?&gt;
        &lt;div id="art_category"&gt;&lt;p&gt;News&lt;/p&gt;&lt;/div&gt;&lt;!-- end of category --&gt;
        &lt;div id="art_title"&gt;&lt;p&gt;Sherlock Holmes 2&lt;/p&gt;&lt;/div&gt;&lt;!-- end of art_title --&gt;
        &lt;div id="rounded_artikel"&gt;
            &lt;li&gt;&lt;img src="images/42897.jpg" width="110" height="110" class="art_image"/&gt;&lt;/li&gt;
            &lt;ul&gt;&lt;li&gt;&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec bibendum bibendum magna at egestas. Sed commodo gravida arcu id accumsan. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque vulputate, velit vitae pellentesque condimentum, lectus mi tempor nisl, sed sagittis est massa eu justo. Cras sed quam sed mauris elementum consectetur. Nunc vitae tortor diam, in hendrerit risus. Nulla et diam non libero vehicula blandit. Etiam facilisis, risus mattis venenatis iaculis, risus dolor lobortis sapien, a malesuada magna nibh nec tellus. Integer viverra, sapien quis pellentesque lobortis, tellus erat mattis nulla, vitae laoreet erat dolor sed ante.&lt;/p&gt;&lt;/ul&gt;&lt;/li&gt;
        &lt;/div&gt;&lt;!-- end of rounded_artikel --&gt;
        &lt;div id="art_info"&gt;
            &lt;img src="images/communication-icon.png" width="23" height="23" class="comment"/&gt;&lt;li class="total_komentar"&gt;&lt;a href="#"&gt;123&lt;/a&gt; Komentar&lt;/li&gt;
            &lt;img src="images/40395696544694793.png" width="23" height="21" class="art_date_icon"/&gt;&lt;li class="art_date"&gt;19-06-2012&lt;/li&gt;
            &lt;img src="images/1903484911.png" width="23" height="21" class="author_icon"/&gt;&lt;li class="author"&gt;straw_hat&lt;/li&gt;
            &lt;div id="opt_art&lt;?=$i;?&gt;"&gt;Option&lt;?php echo $i; ?&gt;&lt;/div&gt;
            &lt;div class="opsi&lt;?=$i;?&gt;"&gt;&lt;center&gt;&lt;a href="#"&gt;Readmore&lt;/a&gt; | &lt;a href="#"&gt;Comment&lt;/a&gt;&lt;/center&gt;&lt;/div&gt;
        &lt;/div&gt;&lt;!-- end of art_info --&gt;
    &lt;?php } ?&gt;
&lt;?php include('footer.php'); ?&gt;
</code></pre>
