TL;DR
Please use the existing possibilities which HTML provides before you try to invent new HTML tags, which are very likely to cause problems in the long run.
IMO there are 2 severe problems with your H tag.
- It’s way to similar to h1, h2 … which are valid HTML tags.
So the whole thing is error prone if naming is misleading.
- The format used is also prone to error and will result in invalid HTML code.
Add 2)
In your example hidden
and notes
are attributes for the “h” element. There is a HTML specification how attribute name have to be built.
If you look at the HTML attribute reference you’ll see that hidden is a valid html attribute which has a meaning and will impact rendering.
Try this without the style display: none
* <h hidden notes>This text is hidden -
till someone changes the attribute "hidden" to "Hidden"</h>
So it’s very likely that using plain text as attributes will clash with the existing and future HTML spec.
What should be allowed is: <x-yz note="your text comes here."/>
But
HTML has a comment feature which will never be rendered <!-- comment -->
and will not pollute the DOM.