<div class="main">
<a title="here" href="http://google.com">google.com</a>
<a title="sss" href="www.sss.com">sss</a>
<a title="sss" href="www.sss.com">sss</a>
<a title="sss" href="www.sss.com">sss</a>
<a class="click" href="#">check site</a>
</div>
<div class="main">
<a title="here" href="http://stackoverflow">stackoverflow</a>
<a title="sss" href="www.sss.com">sss</a>
<a title="sss" href="www.sss.com">sss</a>
<a title="sss" href="www.sss.com">sss</a>
<a class="click" href="#">check site</a>
</div>
<div class="main">
<a title="here" href="http://cnn.com">cnn.com</a>
<a title="sss" href="www.sss.com">sss</a>
<a title="sss" href="www.sss.com">sss</a>
<a title="sss" href="www.sss.com">sss</a>
<a class="click" href="#">check site</a>
</div>
i posted the following code:
$(".click").click(function(){
alert($(this).parent().filter("[title=here]").attr('href'));
})
but it returns undefined. Is there a way to get the current site from the current DIV?