Created
September 25, 2011 11:30
-
-
Save flipflop/1240513 to your computer and use it in GitHub Desktop.
Get a class name from multiples
This file contains 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
<div id="main" class="style1 style2 style3"> | |
</div> | |
<script> | |
console.log(main.className.split(" ")[0]); // first className | |
console.log(main.className.split(" ")[1]); // second className | |
console.log(main.className.split(" ")[2]); // third className | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment