I have a code at a button
onClick="$('img').removeClass('highlighted');$(this).addClass('highlighted')
well it will make the button gets highlighted but is it possible to add a check statement in there to see if the button is already highlighted and dehighlight it rather then letting it just stay highlighted?
You can do this with the jQuery method:
hasClass