jquery click & get value of attributes of a href
Have you tried: $(this).attr()? http://api.jquery.com/attr/
try the following
$('a.preActNav').click(function() {
alert($(this).attr('seq'));
});
you need to use $(this) jquery selector instead
Try this
$('a.preActNav').click(function() {
alert($(this).attr('seq'));
//To get href
alert(this.href);
});
Like this:
alert($(this).attr('seq'));
Although it may be better to put seq
as another data element:
<li><a href="#preclose4" data-theme="a" data-icon="arrow-d" data-transition="none" data-seq='1' class="preActNav" ID="preActNavA">A</a></li>
So then you can do:
alert($(this).data('seq'));