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
19 lines (18 loc) • 805 B
TypeScript
/**
* Does all (or any) of the listed class names exist in the DOM elements list of class names
*
* @param elm - DOM element to test
* @param classNames - Class names to test
* @param any - Test if at least one class name exist
* @return All/any class names listed were found in the elements list of class names
*/
declare function hasClass(elm: Element, classNames: string | string[], any?: boolean): boolean;
export default hasClass;
/**
* Does any of the listed class names exist in the DOM elements list of class names
*
* @param elm - DOM element to test
* @param classNames - Class names to test
* @return At least one of the class names listed were found in the elements list of class names
*/
export declare function hasAnyClass(elm: Element, classNames: string | string[]): boolean;