The removeClass function takes a function argument since jQuery 1.4.
$("#hello").removeClass (function (index, className) {
return (className.match (/(^|\s)color-\S+/g) || []).join(' ');
});
Live example: http://jsfiddle.net/xa9xS/1409/
More Related Contents:
- jQuery Adding new option to select element doesn't pick up the string [closed]
- how to get source of a page
- Slide down button to show text HTML CSS
- Use jQuery to change a second select list based on the first select list option
- Change Active Menu Item on Page Scroll?
- Selecting HTML comments with jQuery
- How to adjust the column width of jqgrid AFTER the data is loaded?
- Can I get div’s background-image url?
- Number input type that takes only integers?
- How to get a cookie from an AJAX response?
- Making radio buttons look like buttons instead
- Cannot modify content of iframe, what is wrong?
- Is there a jquery event that fires when a new node is inserted into the dom?
- Setting equal heights for div’s with jQuery
- How to display an IFRAME inside a jQuery UI dialog
- HTML Table to JSON
- HTML Attribute rel Errors using fancyBox
- Can I fade in a background image (CSS: background-image) with jQuery?
- Select elements without any class [duplicate]
- JQuery data selector not updating with .data
- How can I find the closest previous sibling with class using jQuery?
- Find all unchecked checkboxes in jQuery
- How to preview selected image in input type=”file” in popup using jQuery? [duplicate]
- CSS for the “down arrow” on a element?
- How to create a diagonal line within a table cell?
- jQuery – draggable images on iPad / iPhone – how to integrate event.preventDefault();?
- How to get form html() via jQuery including updated value attributes?
- Show/ Hide Table Column with colspan using jQuery
- Async and document ready
- How can I change text after time using jQuery?