Manipulating classes with jquery
问题 I have a select box with values: apple-80 apple-100 apple-120 apple-300 I have: <body class="fruit apple-120 otherclass anotherclass"> I want to manipulate the body class "apple-120" to get replaced by any of selected value from the select box while keeping the fruit, otherclass, anotherclass, class untouched. So far I created this: $.fn.classSwitcher = function(options) { var baseOptions = { classTarget: 'body', oldClass: 'apple-120' }; var options = $.extend(baseOptions, options); return