by sergiotapia · 12y ago · 0 comments
data-progrecss="X"
using JS or whatever at each "progress step" update.I wanted to make the demo page as minimalist as possible. Maybe I will just add (using js) after step three.
But yes you can use js, something like
$('.myprogrecss').attr('data-progrecss', <PERCENT>); (if using jQuery)
Or I believe Document.getElementById('myProgrecss').setAttribute('data-progrecss', <PERCENT>);
DISCLAIMER, this code just popped out of my head so it's probably not quite correct but near abouts.EDIT: I've added that little piece to the demo page.
document.getElementById('myProgrecss').dataset.progrecss = '<PERCENT>';
[0]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement...Thanks for that :) I was actually unaware of that method and I prefer that style if I'm honest.
Thanks!
$('.myprogrecss').data('progrecss', 60);I don't know why jq does this.
Since you can't really set element attributes to non-string values, trying to sync the 'data' values with element attributes raises all sorts of unwanted problems.
Thanks
Thanks!