Current | if( document.querySelectorAll(".module--PageHeaderV2").length ) {
document.querySelectorAll(".module--PageHeaderV2").forEach(el => {
});
}
if( document.querySelectorAll(".module--NavigationV2").length ) {
document.querySelectorAll(".module--NavigationV2").forEach(el => {
});
}
if( document.querySelectorAll(".module--CardModuleV2").length ) {
document.querySelectorAll(".module--CardModuleV2").forEach(el => {
});
}
if( document.querySelectorAll(".module--IconGridV2").length ) {
document.querySelectorAll(".module--IconGridV2").forEach(el => {
});
}
if( document.querySelectorAll(".module--ContactV2").length ) {
document.querySelectorAll(".module--ContactV2").forEach(el => {
});
}
if( document.querySelectorAll(".module--TestV2").length ) {
document.querySelectorAll(".module--TestV2").forEach(el => {
});
}
| ready |
New | document.querySelectorAll(".module").forEach(el => {
let classes = el.classList;
if( classes.contains("module--PageHeaderV2") ) {
} else if( classes.contains("module--NavigationV2") ) {
} else if( classes.contains("module--CardModuleV2") ) {
} else if( classes.contains("module--IconGridV2") ) {
} else if( classes.contains("module--ContactV2") ) {
} else if( classes.contains("module--TestV2") ) {
}
});
| ready |
New - Regex | document.querySelectorAll(".module").forEach(el => {
let classes = el.classList;
let moduleMatch = el.className.match(/(module\-\-)(?:\S+)/g);
let className = moduleMatch[0].split("--")[1];
if( className === "PageHeaderV2" ) {
} else if( className === "NavigationV2" ) {
} else if( className === "CardModuleV2" ) {
} else if( className === "IconGridV2" ) {
} else if( className === "ContactV2" ) {
} else if( className === "TestV2" ) {
}
});
| ready |
New - Specific Selector | document.querySelectorAll("section.module").forEach(el => {
let classes = el.classList;
if( classes.contains("module--PageHeaderV2") ) {
} else if( classes.contains("module--NavigationV2") ) {
} else if( classes.contains("module--CardModuleV2") ) {
} else if( classes.contains("module--IconGridV2") ) {
} else if( classes.contains("module--ContactV2") ) {
} else if( classes.contains("module--TestV2") ) {
}
});
| ready |
New - Regex Specific Selector | document.querySelectorAll("section.module").forEach(el => {
let classes = el.classList;
let moduleMatch = el.className.match(/(module\-\-)(?:\S+)/g);
let className = moduleMatch[0].split("--")[1];
if( className === "PageHeaderV2" ) {
} else if( className === "NavigationV2" ) {
} else if( className === "CardModuleV2" ) {
} else if( className === "IconGridV2" ) {
} else if( className === "ContactV2" ) {
} else if( className === "TestV2" ) {
}
});
| ready |