Finding closest id within span
<p>I have two images within span. I need the value of id1 for each image-click.</p>

<pre><code>&lt;span class="deleteid"&gt;
  @Html.ActionLink(item.categoryModel.catName, "Show", new { id1=item.itemId})
  &lt;img id="iconItemEdit" src="@Url.Content("~/Content/MyIcons/ee.png")" 
   style="width: 13px; height: 13px;"/&gt;

  &lt;img id= "iconDelete" src="@Url.Content("~/Content/MyIcons/delete.png")" 
    alt="delete" style="width: 13px; height: 13px;"/&gt;
&lt;/span&gt;
</code></pre>

<p>For first image I used</p>

<pre><code>$('#iconItemEdit').live('click', function () {
    var it = $(this).prev().attr('id1');
</code></pre>

<p>It is working fine. I am having problem finding id for the second image. I tried using same code but it did not work.</p>

<pre><code>$('#iconDelete').live('click', function () {
    var it = $(this).prev().attr('id1');
    alert(it);
</code></pre>

<p>is returning <code>undefined</code> instead.</p>
