a little jQuery extension that removes multiple attributes, with white- and black-lists.

the first argument is a list of attributes to remove. if omitted, it removes all attributes on the element, except those in the second argument. both are arrays of strings.


This can actually be a handy function for sanitizing HTML input, for example in a Rich Text Editor where you want to allow pastes from Word or dragging HTML content into a contentEditable div – pass the html() to a temp div, removeAttributes on all elements, then pass it to your DB.