I am new in jQuery
,I am trying to get the value of href attribute when the user clicks on a link but I am getting same values for href attributes.
here is my html code
<div class="container">
<ul>
<li><a href="#1" >Sign In</a>
</li>
<li><a href="#2">Brand</a>
</li>
<li><a href="#3">Distributor Brand</a>
</li>
<li class="language"> <a href="#4">English</a>
<ul id="language-select">
<li><a href="#5">Spanish</a>
</li>
<li><a href="#6">French</a>
</li>
<li><a href="#">German</a>
</li>
</ul>
</li>
</ul>
</div>
and js
$(document).ready(function(){
$("a").click(function(){
var value=$(".container").find("a").attr("href");
alert("hello------> "+value);
});
});
Here's the fiddle http://jsfiddle.net/suraj0750/rmbvo9oh/1/