.parent()
- that’s all you need!
$("img.active").parent().attr("href");
Here is the documentation :)
According to Kyle's comment, and trying to do something as reliable as possible, you can try:
$("img.active").closest('a[href]').attr("href");
, html :
<a href="something.html">
<a name="anchor">
<img src="img1.jpg" class="active">
</a>
</a>
, :)