How do you check if the class that is assigned to a div? For example, I want to check if a div has a class of header-link
then it should alert a message box similar to this:
$('.header a').click(function()
{
if($(this).classname == 'header-link')
{
alert('the element has the class name already');
}
else
{
$(this).addClass('header-link');
}
});
The classname
I put in there is an example I need to make it check if it has the class assigned or not... (even when jQuery has assigned it dynamically).