DataSet Property are Case-Insensitive
HTML is case-insensitive, but often forgotten that dataset property name either. such as:
<div data-foobar data-fooBar data-foo-bar><div>
data-foobar
data-fooBar
are the same thing, map to dom dataset API of .dataset.foobar
property.
To create a camel case dataset property, use dash separated, such as foo-bar
as `dataset.fooBar.
If double dash foo--bar
used, map to dataset['foo-Bar']
.
网友评论