Hello, I'm looking for a way using jquery/javascript to get a class name when I only know part of it and there are more than one classes applied to that element.
So if I'm looking for a class that I know starts with "charLimit_" I want to know that full class name even when it's not the only class applied to a given element. Example HTML would be.
<input class="charLimit_30 lastNameValidation" type="text" />
What I have so far below will put both "charLimit_30" and "lastNameValidation" into an array, but how do I then say I only want "charLimit_30" and then only tell me the value found after the underscore (30).
var classMName = $('[class*=charLimit_]').attr("class").split(' ');
Thanks in advance for you help!!!