The set of global attributes depends on HTML version. Browser support varies, too.
For example, according to the W3C HTML5 document (which is a draft that may change at any moment without prior notice, but still regarded as “de facto standard” by many), the set of global attributes is very large and potentially infinite (it includes any attribute that starts with
data- and satisfies some general constraints).
There is no attribute that needs to be used for every tag. You use attributes because you have some use for them, or expect to have use for them in the future. For example, it is a good idea to assign an
id attribute to any subheading (like
h2), because people visiting the page may wish to set up links that refer to a specific section there.
Some attributes have pitfalls or even flaws. For example,
accesskey, originally meant for accessibility, tends to work against it, due to wrong design and implementations. Using
tabindex normally means that you should have designed the page differently. Using event handler attributes (