Created
March 31, 2024 16:26
-
-
Save chris-castillo-dev/8ba020d713980654e14d5cff0566a8c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the <body> element | |
const bodyElement = document.querySelector('body'); | |
// Extract all classes on the <body> element | |
const bodyClasses = Array.from(bodyElement.classList); | |
// Join the classes into a comma separated string | |
const bodyClassesString = bodyClasses.join(','); | |
return bodyClassesString; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment