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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -