For complex types it is. But why and when do you need to store complex types in the DOM? Isn't that always a bad idea?
I'm a seasoned web dev, but haven't been working on complex frontend apps, because I believe complexity and frontend web don't go together. So I may very well miss some use-cases.
As said: I'm unfamiliar with these concepts as I actively try to avoid them :)
It can look cleaner (matter of taste). It looks like a native JS assignment, and it's shorter.
For open and hidden, it's way more intuitive and convenient to set and get booleans than testing the existence of the corresponding HTML attribute (Still not a fan of this thing, years after having learned this).
(but maybe you meant "Why use domElement.randomprop instead of something like domElement.dataset.randomprop"?)
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaEl...