ghosh / microtip

💬 Minimal, accessible, ultra lightweight css tooltip library. Just 1kb.
https://microtip.vercel.app/
MIT License
1.38k stars 74 forks source link

role="tooltip" causes invalid HTML for anchor tags with href #67

Open Piggered opened 3 years ago

Piggered commented 3 years ago

This is an add-on to #5.

When using the library to an <a> tag with an href, the HTML becomes invalid according to the W3C validator.

For instance:

<a href="https://github.com/" aria-label="GitHub" data-microtip-position="bottom" role="tooltip">GitHub</a>

will produce the following error:

Attribute href not allowed on element a at this point.

Removing role="tooltip" clears the error, but the tooltip obviously won't work.