Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can also just set dataset[0] on the raw element:

    document.getElementById('myProgrecss').dataset.progrecss = '<PERCENT>';
[0]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement...


Hey woogley,

Thanks for that :) I was actually unaware of that method and I prefer that style if I'm honest.

Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: