MCPcopy Index your code
hub / github.com/IanLunn/Sequence / hasClass

Function hasClass

scripts/sequence.js:460–467  ·  view source on GitHub ↗

* Does an element have a particular class? * * @param {HTMLElement} element - The element to check * @param {String} name - The name of the class to check for * @returns {Boolean} * @api private

(element, name)

Source from the content-addressed store, hash-verified

458 * @api private
459 */
460 function hasClass(element, name) {
461
462 if (element === undefined) {
463 return;
464 }
465
466 return new RegExp('(\\s|^)' + name + '(\\s|$)').test(element.className);
467 }
468
469 /**
470 * Add a class to an element

Callers 3

addClassFunction · 0.70
removeClassFunction · 0.70
defineSequenceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…