<div> <a> <img> </a> <p></p> </div> --------------- <div> <a> <img> </a> <p></p> </div> ---------------- All I want to do is using the img tag selected as $(this) to select the contents of <p> tag in the outer div?? var thumbcap = $j(this).parent('a').closest(p).html(); ??? This selects always the firs div p content. Thank you in advance...
$(this).parents('div').find('p').html(); should work - however, in the code you provided there's no "outer" div - there are consequtive divs - ie, first one div, containing an A, an IMG and a P-tag, then another DIV containing the same.