Is there a way to instantly change the color of my span element when it's clicked by the user, rather than waiting for the mouse button to be released?
This is the CSS code I'm using for the class:
span.active{
color:#bdbcae;
}
I've tried this jQuery code, but it toggles the class after the click event:
$("span").click(function() {
$(this).toggleClass("active");
});
I'm not sure if this requires a simple solution or something more complex. What kind of function should I use to achieve the desired result?