add click event to all li which has id - using jquery
<p>I need to add the click event to all the <code>li's</code> inside a div which has id to the li.</p>

<p>The following script changes for all the li's:</p>

<pre><code>   &lt;ul&gt;
    &lt;li&gt;
    &lt;h4&gt;My Header&lt;/h4&gt;&lt;/li&gt;
    &lt;li id="myli1"&gt;My li 1&lt;/li&gt;
    &lt;li id="myli2"&gt;My li 2&lt;/li&gt;&lt;/ul&gt;


        $("#mydiv li").live('click', function(e) {
            alert($(this).attr("id"));
          });
</code></pre>

<p>I need to add the click events for only the li which has the id attribute.</p>
