HTML5 Changed attributes

Changed Attributes

Several attributes have changed in various ways.

  • The accept attribute on input now allows the values audio/*video/* and image/*.
  • The accesskey global attribute now allows multiple characters to be specified, which the user agent can choose from.
  • The action attribute on form is no longer allowed to have an empty URL.
  • In WHATWG HTML, the method attribute has a new keyword dialog, intended to close a dialog element.
  • The border attribute on table only allows the values “1” and the empty string. In WHATWG HTML, the border attribute is obsolete.
  • The colspan attribute on td and th now has to be greater than zero.
  • The coords attribute on area no longer allows a percentage value of the radius when the element is in the circle state.
  • The data attribute on object is no longer said to be relative to the codebase attribute.
  • The defer attribute on script now explicitly makes the script execute when the page has finished parsing.
  • The dir global attribute now allows the value auto.
  • The enctype attribute on form now supports the value text/plain.
  • The width and height attributes on imgiframe and object are no longer allowed to contain percentages. They are also not allowed to be used to stretch the image to a different aspect ratio than its intrinsic aspect ratio.
  • The href attribute on link is no longer allowed to have an empty URL.
  • The href attribute on base is now allowed to contain a relative URL.
  • All attributes that take URLs, e.g. href on the a element, now support IRIs if the document’s encoding is UTF-8 or UTF-16.
  • The http-equiv attribute on meta is no longer said to be used by HTTP servers to create HTTP headers in the HTTP response. Instead, it is said to be a pragma directive to be used by the user agent.
  • The id global attribute is now allowed to have any value, as long as it is unique, is not the empty string, and does not contain space characters.
  • The lang global attribute takes the empty string in addition to a valid language identifier, just like xml:lang does in XML.
  • The media attribute on link now accepts a media query and defaults to “all”.
  • The event handler attributes (e.g. onclick) now always use JavaScript as the scripting language.
  • The value attribute of the li element is no longer deprecated as it is not presentational. The same goes for the start and type attributes of the ol element.
  • The style global attribute now always uses CSS as the styling language.
  • The tabindex global attribute now allows negative values which indicate that the element can receive focus but cannot be tabbed to.
  • The target attribute of the a and area elements is no longer deprecated, as it is useful in Web applications, e.g. in conjunction with iframe.
  • The type attribute on script and style is no longer required if the scripting language is JavaScript and the styling language is CSS, respectively.
  • The usemap attribute on img no longer takes a URL, but instead takes a valid hash-name reference to a map element.

The following attributes are allowed but authors are discouraged from using them and instead strongly encouraged to use an alternative solution:

  • The border attribute on img. It is required to have the value “0” when present. Authors can use CSS instead.
  • The language attribute on script. It is required to have the value “JavaScript” (case-insensitive) when present and cannot conflict with the type attribute. Authors can simply omit it as it has no useful function.
  • The name attribute on a. Authors can use the id attribute instead.