I'm trying to get the name of a class that matched a regex of a checked input.
If I have this:
<input type="radio" class="toggle toggle-1" />
<input type="radio" class="toggle toggle-2" checked="checked" />
<input type="radio" class="toggle toggle-3" />
I want to find out that 'toggle-2' is the checked class.
$('.toggle:checked').className.match(/toggle\-.+?\b/);
But that produced 'className is undefined' errors.
I think my problem is that I'm using className against a jQuery object. But I'm not really sure what the alternative is.