hasClass Method

Summary

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

Syntax

JavaScript Syntax
hasClass = function( 
   element, 
   className 
) 
TypeScript Syntax
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 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly