Created
March 19, 2013 04:33
-
-
Save ThomasHambach/5193734 to your computer and use it in GitHub Desktop.
Get first classname using jQuery.
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
<a id="myelement" href="http://google.com" class="class1 class2 class3">Go to google</a> | |
<script> | |
$('a#myelement').attr('class').split(' ')[0]; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment