$(".m").toggle(
$(".m").addClass('on'),
$(".m").removeClass('on')
);
This doesn’t seem to work the way I want it to, am I doing this wrong or is it something else?
I tried your ways, they seemed to work but this problem is in the css, its not showing .on, it looks like this:
a.m {color:red;}
a.m:hover {color:blue;}
a.m:active, .on {color:green;}
try using
.toggleClass()Reference: .toggleClass