<div
id="element"
data-abc-def="camelcaseexample"
data-empty
data-emptystring=""
data-null="null"
data-true="true"
data-false="true"
data-1="1"
data-json='{"x":1,"str":"foo"}'
double="1"
double="2"
data-double="1"
data-double="2"
>
target element
</div>
<div id="target"></div>
<hr>
<div>
note on jQuery .data():<br>
<a target="_blank" href="https://api.jquery.com/data/#data-html5">jQuery .data() and value conversion info</a><br>
quote:
<div>
Every attempt is made to convert the attribute's string value to a JavaScript value (this includes booleans, numbers, objects, arrays, and null). A string is only converted to a number if doing so doesn't change its representation (for example, the string "100" is converted to the number 100, but "1E02" and "100.000" are left as strings because their numeric value of 100 serializes to "100"). When a string starts with '{' or '[', then jQuery.parseJSON is used to parse it; it must follow valid JSON syntax including quoted property names. A string not parseable as a JavaScript value is not converted.
To retrieve a data-* attribute value as an unconverted string, use the attr() method.
</div>
</div>