MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / hasClass

Function hasClass

libs/leaflet/leaflet-src.js:2422–2428  ·  view source on GitHub ↗
(el, name)

Source from the content-addressed store, hash-verified

2420 // @function hasClass(el: HTMLElement, name: String): Boolean
2421 // Returns `true` if the element's class attribute contains `name`.
2422 function hasClass(el, name) {
2423 if (el.classList !== undefined) {
2424 return el.classList.contains(name);
2425 }
2426 var className = getClass(el);
2427 return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className);
2428 }
2429
2430 // @function addClass(el: HTMLElement, name: String)
2431 // Adds `name` to the element's class attribute.

Callers 2

addClassFunction · 0.85
leaflet-src.jsFile · 0.85

Calls 2

getClassFunction · 0.85
containsMethod · 0.45

Tested by

no test coverage detected