I would say that you should rename the tooltip-title attribute to data-tooltip-title the general HTML spec doesn't like when sites implement custom attributes that aren't prepended by a data-.
This is because not all browsers work with custom attributes as intended, older browsers might not be able to understand attributes that aren't explicitly defined in the w3c spec unless placed with data-. Placing data- also future proofs browsers as if there is any change in the future where tooltip-title becomes an accepted standard in HTML, this implementation would break.
I would say that you should rename the
tooltip-title
attribute todata-tooltip-title
the general HTML spec doesn't like when sites implement custom attributes that aren't prepended by adata-
.This is because not all browsers work with custom attributes as intended, older browsers might not be able to understand attributes that aren't explicitly defined in the w3c spec unless placed with
data-
. Placingdata-
also future proofs browsers as if there is any change in the future wheretooltip-title
becomes an accepted standard in HTML, this implementation would break.More information here:
[1] w3.org/TR/2011/WD-html5-20110525/e....
[2] developer.mozilla.org/en-US/docs/W...
Thank you for pointing that out. As you said, it is always good to use a custom data attribute.
In the DIY examples mentioned above, I wanted to keep it simple and easy to understand. They can always have their own way of defining the attributes.