Hi all
I have a link as such:
[CODE]<a onclick=”setSubTagStatus(1, ‘myString’)”>My Link</a>
And I have the JS function as such:
[CODE]
function setSubTagStatus(tagid, tagstring) {
$(“#subtagbox_”+tagstring+”> a”).click(function() {
if ($(this).hasClass(‘active’)) {
$(this).removeClass(“active”);
} else {
$(this).addClass(“active”);
}
});
}
In a nutshell, I need to set add/remove a class called ‘active’ to/from a link that is clicked within a DIV.
So if the link has the class ‘active’ already assigned I need to remove it and vice versa however the issue I am having is that I have to [B]double click
Any ideas why double clicking works but single clicking doesn’t?
Thanks for reading.