3 ms·
The reason is simply that I wanted it to be as simple as possible, but if it seems to be a common request I could add support for data-attributes! (and yes, it
by Javve 15y ago
The reason is simply that I wanted it to be as simple as possible, but if it seems to be a common request I could add support for data-attributes! (and yes, it "works" in IE, by using getAttribute())
- catshirt 15y agoi used to use class names to store data types (category is a perfect example). there's a really great reason to do this: you can style your objects based on that type of data without relying on CSS attribute selectors. that said, i quickly learned that it's better to use data- attributes and copy them into the class when necessary. otherwise you end up with utilities like getCategoryFromClassName()