how do you force the text value in the html 5 data attribute when accessing it in js?
I have a global application with a similar html line:
<div class="slider" data-max="125" data-cost="10000" data-costtext="10.000">
the. in the text, the cost value is accurate for some languages. When accessing this value through jQuery js
$("div.slider","body").data("costtext")
you will return 10 .
Is re-writing my only option ?, for example:
<div class="slider" data-obj='{"max":125,"cost":10000,"costtext":"10.000"}'>
Defygravity
source share