Can I add a custom attribute to an HTML tag like the following?
well! you can actually create a bunch of custom HTML attributes by disguising the data attributes in what you actually want.
eg.
[attribute='value']{
color:red;
}
hello world
It apparently works but that would invalidate your document, there is no need of using JScript for you to have custom attributes or even elements unless you have to, you just need to treat your new formulated(custom) attributes just the same way you treat your "data" attribute
Remember "invalid" does not mean anything. The document will load fine at all the time. and some browsers would actually validate your document only by the presence of DOCTYPE....., you actually know what I mean.