Reputation: 3681
I have an element which is annotated with 3 css classes input-small JFilterInput Status
.
where class name varies except input-small JFilterInput
.
I need to select varying class name using some jquery
selector.
I tried
var selectedClassName = $(this).attr('class:not(.JFilterInput)');
But it didn't work. How to do this..??
Upvotes: 1
Views: 97
Reputation: 388436
Try
var selectedClassName = $.trim(this.className.replace(/\b(input-small|JFilterInput)\b/g, ''))
Upvotes: 3