Using a value which is a valid Javascript identifier
permits using it globally, directly, as a reference
to the element. An interesting difference on Chrome vs. Firefox
when the id is duplicated:
Firefox returns the first match, Chrome a list of all matches.
This may break pages that use globalId.elemFunc
but in any case duplicate id is illegal.
class Classes
Work as a "mode", with an unordered set of boolean "flags".
title Title
Work as an accessibility hint.
Commonly displayed as on-hover tool-tip,
which defeats most of its purpose.
Remains required or advised in many situations.
item* Microdata
The itemscope flag
marks a sub-tree as giving props as typed key-values,
according to a type specification provided
as a URL value via itemtype,
similar to xmlns.
Each prop sub-tree specifies the key
with itemprop='key'
and its contents represent the value.
The exact specification is given in the
HTML Living Standard, §5 .
See the following example for a sample
car model microdata.
CSS selectors on microdata attributes
come in useful.
Modifier keys are conviniently included with modified keys.
The document event handlers will not work,
neither directly on body,
when it is styled display:contents.
See the WASD experiment page for a work-around.
Clipboard
Access to navigator.clipboard
requires clipboardRead, clipboardWrite.
The document copy/cut/paste events work without,
but with opaque data.
Scroll and Wheel
Scroll and Wheel events happen on normal scrollable elements, but:
Wheel events append also on unscrollable elements.
Scroll events append also when scrolling by keyboard or scroll-bar.
The Wheel deltas do not reflect the scroll direction (which is a user pref).