I was wondering if it’s possible in jQuery to know if an element is clicked or hasClass()
This is what I’ve tried without success
if($('.subCat span[data-value="all"]').hasClass('checked') || $('.subCat span[data-value="all"]').click()){
alert('woohoo');
}
So how can I achieve this? I need to script to be executed when clicked or if it has the required class.
Thanks
What you need is a click event, not an if statement.