 <p>Add an <code>event</code> parameter to your handler function, and then use <code>event.target</code> to get the <code>&lt;a&gt;</code> element that was clicked. From there you can go up to the parent <code>&lt;div&gt;</code> and back down to the <code>&lt;span&gt;</code>.</p> <pre><code>$('#resultats_son').click(function(event){ var spanId = $(event.target).parent('div').children('span').attr('id'); $('#resultats_son_div').hide(); $('#player_son_div').show(); $('#player_son').html("&lt;iframe ...&gt;&lt;/iframe&gt;").show(); //Show second div on click event return false; }); </code></pre>