Reputation: 53
I have elements with clas="a 1" and "a 2", etc. I want to select the last class. For example in "a 1", select 1 and make it 2. How could I do that?
Upvotes: 0
Views: 29
Reputation: 43479
Simply remove class and add required:
$('.a.1').removeClass('1').addClass('2');
Upvotes: 1