How to capture id of clicked div - jquery
<p>I am posting this questions due to the <a href="http://stackoverflow.com/questions/16103610/how-to-get-id-of-clicked-div-jquery">previous one</a> being so long (It might create confusion if I cut parts up in it). I made the question more simple in this post :).</p>

<p>jQuery code:-</p>

<pre><code>function op_prof(id) {
    var attr_u_search = $(".u_search").attr('id');
    var dataString = 'u_search=' + attr_u_search;
    alert(dataString);

    $.ajax({
    type: "POST",
    url: '/script/profile.php',
    data: dataString,
    cache: false,
    success: function(data) {
          $('#ui_profile').show();
          $('#ui_profile').html(data);
          location.hash = 'profile' + 'id=' + dataString;
          $(".searchbox").val('');
          $("#usr_suggest").hide();

    }
  });
};
</code></pre>

<p>PHP:-</p>

<pre><code>echo "&lt;tr id='" . $id . "' class='u_search' height='40px' onclick='javascript:op_prof(1)'&gt;&lt;td width='40px'&gt;&lt;img class='avatar' src='$avater' /&gt;&lt;/td&gt;&lt;td&gt;" . $fname_ . " " . $lname_ . "&lt;/td&gt;&lt;/tr&gt;";
}}
</code></pre>

<p>I am having trouble retrieving the <code>ID</code> of each <code>div</code> (each one has a unique <code>ID</code>). It seems that the jQuery captures the <code>ID</code> of the <code>div</code> on top (the first <code>div</code>) instead of capturing the <code>ID</code>s of all the <code>divs</code>.
<br><br>Screen shots:-
<br><a href="http://prntscr.com/118dhv" rel="nofollow">http://prntscr.com/118dhv</a>
<br><a href="http://prntscr.com/118dus" rel="nofollow">http://prntscr.com/118dus</a>
<br><br>P.S: I am 100% sure that there is an error in the jQuery :-> prntscr.com/118eb5</p>
