Can I have attributes on closing tags?

The answer is no for most tags. However, you could argue that tags like "img" that can be self-closing, are able to have attributes in them. But these self-closing tags are taking the place of an opening tag and a closing tag, so it's not the same as having an attribute in a closing tag. To be honest, there is really no need for this, it would just create more for the browser to have to read and make the page size bigger.


Sorry, but it doesn't work and doesn't validate.

If you try other attributes in closing tags, then the browser skips the attribute. I tried it in several ways, tested it with ids and classes, and the css and the javascript didn't recognized them in the ending tag. Your best bet is the commenting.

EDITED

Or you could make your own html tags.

You must use hyphenation, and you should avoid

document.createElement('foo-bar');

Short answer, No.

Use the comments instead.

Tags:

Html