Global Attributes

id Identifier

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.

Skoda Rapid

  • Body
  • Hatchback
  • 5
  • Speed
  • 205 km/h
  • Engine
  • 1395 cc
  • Petrol, E10
  • 6,1 l/100km
  • 114 g/km
  • 7
  • on* Event Handlers

    The handlers are specified in the HTML Living Standard, §8

    Window
    onbeforeprint before document printed
    onafterprint after document printed
    onbeforeunload document about to unload
    onerror error has occured
    onhashchange hash-fragment in URL changes
    onload page is finished loading
    onmessage message is triggered
    onoffline browser starts to work offline
    ononline browser starts to work online
    onpagehide user navigates away from a page
    onpageshow user navigates to a page
    onpopstate window's history changes
    onresize browser window is resized
    onstorage Web Storage area is updated
    onunload page has unloaded or window closed
    Touch
    touchstart
    touchend
    touchcancel
    touchmove
    Form
    oninput during use (e.g. slider dragged)
    onchange after use (e.g. slider released)
    onsubmit via submit elements or Enter

    Mouse, Keyboard, Page-Global Events

    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).