I have an anchor, as follows:
<a href="#" class="fpa2" value="7">
<div class="pl2">
<div class="pl3">Hero</div>
</div>
</a>
Using jQuery, how do i get a variable with the value 7 from the value field on click?
I tried:
$('.fpa2').on("click", function(){
var a1 = $(this).val();
});
but this is returning a blank value.
1 Answer