Reputation: 477
$('.shortcode').removeClass('.shortcode');
$('.shortcode').hide();
Why .shortcode
items gets hidden anyway? In source code they still have shortcode class.
Upvotes: 0
Views: 1418
Reputation: 106375
You shouldn't use .
in the string passed to removeClass
: this...
$('.shortcode').removeClass('shortCode');
... is sufficient. Think of it: if method is intended to remove a class anyway, why should you mark its argument with the class sigil (.
)? :)
With dot in front of the real className, jQuery tries to remove '.shortCode'
class - obviously, it's a no-op here.
Upvotes: 5
Reputation: 5410
Remove the dot '.'. This will work
$('.shortcode').removeClass('shortCode');
Upvotes: 11