HubSpot/youmightnotneedjquery — pull request #75 by krasimir (2014-06-26 08:58:24+00:00)
Title: Completing the `add class` snippet

This pull request is almost the same as [this one](https://github.com/HubSpot/youmightnotneedjquery/pull/56). However, I decided to make a new one.

There are two problems with the current suggestion of adding a new class under IE:

a) If there is no class assigned so far the new one is added with an interval in front. I.e. it looks class=" my-class" and not class="my-class".
b) There is no check if the class is already added

Here is a JSBin demonstrating how the new version works - http://jsbin.com/ciqibori/3/edit?html,js,console