Skip to main content

removeClassNamesFromElement

function

Takes an HTML element and removes the classNames passed within an array, ignoring any non-string types. A space can be used to remove multiple classes eg. removeClassNamesFromElement(element, ['active small', true, null]) will remove both the 'active' and 'small' classes from that element.

function removeClassNamesFromElement(element: HTMLElement, ...classNames: (typeof undefined | boolean | null | string)[]): void

Import

import { removeClassNamesFromElement } from '@modular/sdk/editor';