hasClass Method

Summary

Checks an HTML or SVG element for the given class string.

Syntax
TypeScript
JavaScript
hasClass = function( 
   element, 
   className 
) 
static hasClass( 
   element: HTMLElement, 
   className: string 
): boolean; 

Parameters

element

HTML or SVG element to check.

className

The class string.

Return Value

true if the element has the className; else, false.

Remarks

Like AddClass and RemoveClass, this method also works with browsers that do not support the HTML element classList property. This method will throw an error if the element is null or undefined.

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly