$("#showKey").each(
$(this).click(function(){
alert($(this).attr("value"));
})
);
And
<a id="showKey" href="#" value="{{ customer.key }}">
<span class="icons icon-key"></span>
Show key
</a>
The alert gives and undefined output, just 'undefined'. I have a list of customers and a click on #showKey should reveal the key for the clicked customer.
Whats wrong with my code?
eachon id selector? do you have multiple elements with the same id? It's an invalid HTML!