<a class="ab ac ad">HOME</a>
I need the second class attribute, something like this:
$("a").click(function(){
var a = $(this).attr("class").eq(1);
alert (a);
});
Any idea ?
<a class="ab ac ad">HOME</a>
I need the second class attribute, something like this:
$("a").click(function(){
var a = $(this).attr("class").eq(1);
alert (a);
});
Any idea ?
You get a string, so you can just split it:
var a = $(this).attr("class").split(' ')[1];
You can split by space using:
echo $(this).attr("class").split(' ')[1];