vendredi 10 avril 2015

Trying to add class using if and else but not working properly

I am trying to add class using if and else,but its not working beyond if not reaching to else.



$('.headings aside').click(function() {
if ($(this).children('span').hasClass("fa-caret-up")) {
$(this).children('span').addClass('borderGap');
alert("Hello! I am an alert box!!");
} else {
alert("Second Alert");
$(this).children('span').removeClass('borderGap');
};
});


Thanks in advance


Aucun commentaire:

Enregistrer un commentaire