Just use $('.selector').addClass("myClass");.
The jQuery add/remove class functions both check for duplicates internally, meaning that calling addClass twice only will add the class once.
Just use $('.selector').addClass("myClass");.
The jQuery add/remove class functions both check for duplicates internally, meaning that calling addClass twice only will add the class once.