2 ms·
Not sure you should be (ab)using data- attributes like that. They’re already a key/value pair so you markup your data as <div data-tooltip-foo="baa" data-toolti
by robin_reala 15y ago
Not sure you should be (ab)using data- attributes like that. They’re already a key/value pair so you markup your data as <div data-tooltip-foo="baa" data-tooltip-qux="quux">
- deadbeef84 15y agoIf you have many options, they are easier to retrieve, just call .data('tooltip') and jQuery will do the parsing of the object. Using separate attributes you would have to call .data() for every attribute. Anyway, I guess any of the two methods would be fine! :-)