3 ms·
What does `data--my-cool-attribute` supposed to become?
by lelanthran 3y ago
What does `data--my-cool-attribute` supposed to become?
- jaffathecake 3y agoThe letter after - is uppercased, and the - is removed. So, `div.dataset.MyCoolAttribute`.
- lelanthran 3y agoWon't that clash in this case, with the version that has double hypens?
- jaffathecake 3y agoI'm talking about your example with double hyphens. It's the initial double hyphen that causes the first letter to be uppercase.
- lelanthran 3y ago> I'm talking about your example with double hyphens. It's the initial double hyphen that causes the first letter to be uppercase. I was asking about the initial example, and made a mistake in the question I asked. To clarify, according to the standards, what do the following transformations result in? data-my--cool-data data-my-cool-data
- jaffathecake 3y agoel.dataset['my-CoolData'] and el.dataset.myCoolData respectively