Joined March 2013
·

Dustin Haffner

San Francisco
·
·

Posted to RegExp for checking clases over 1 year ago

Using String.prototype.indexOf to check if a class is already set is problematic if you don't split the string into an array first. It might be safer to rely on jQuery's addClass/removeClass/toggleClass or classList if possible

Achievements
169 Karma
28,492 Total ProTip Views
Interests & Skills