How do I add a CSS class to only one <label> at any given time, using JQuery? -
i have code:
$('#custom-options label').click(function(){ $(this).removeclass('uncheck').addclass('checked'); });
what i'm aiming when click <label>
adds class .checked
. works until click <label>
have 2 labels class .checked
...although want add 1 i've clicked , i'd rest of <label>
s have class .uncheck
.
any appreciated, thanks
$('#custom-options label').click(function(){ $('#custom-options label.checked').removeclass('checked').addclass('uncheck'); $(this).removeclass('uncheck').addclass('checked'); });
Comments
Post a Comment