vanillajs-browser-helpers
Version:
Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS in the browser
9 lines (8 loc) • 340 B
TypeScript
/**
* Replaces css class with another on a DOM element.
*
* @param elm - HTML ELement to remove class names from
* @param classNames - Class names to remove
* @return Returns element given in 'elm'
*/
export default function replaceClass(elm: Element, classNames: string | string[], replacements: string | string[]): Element;