New in HTML5.
Tag |
Description |
Defines a comment |
|
Defines the document type |
|
Defines a hyperlink |
|
Defines an abbreviation |
|
Not supported in HTML5. Use <abbr> instead. |
|
Defines contact information for the author/owner of a document |
|
Not supported in HTML5. Use <object> instead. |
|
Defines an area inside an image-map |
|
Defines an article |
|
Defines content aside from the page content |
|
Defines sound content |
|
Defines bold text |
|
Specifies the base URL/target for all relative URLs in a document |
|
Not supported in HTML5. Use CSS instead. |
|
Isolates a part of text that might be formatted in a different direction from other text outside it |
|
Overrides the current text direction |
|
Not supported in HTML5. Use CSS instead. |
|
Defines a section that is quoted from another source |
|
Defines the document's body |
|
Defines a single line break |
|
Defines a clickable button |
|
Used to draw graphics, on the fly, via scripting (usually JavaScript) |
|
Defines a table caption |
|
Not supported in HTML5. Use CSS instead. |
|
Defines the title of a work |
|
Defines a piece of computer code |
|
Specifies column properties for each column within a <colgroup> element |
|
Specifies a group of one or more columns in a table for formatting |
|
Specifies a list of pre-defined options for input controls |
|
Defines a description/value of a term in a description list |
|
Defines text that has been deleted from a document |
|
Defines additional details that the user can view or hide |
|
Defines a definition term |
|
Defines a dialog box or window |
|
Not supported in HTML5. Use <ul> instead. |
|
Defines a section in a document |
|
Defines a description list |
|
Defines a term/name in a description list |
|
Defines emphasized text |
|
Defines a container for an external (non-HTML) application |
|
Groups related elements in a form |
|
Defines a caption for a <figure> element |
|
Specifies self-contained content |
|
Not supported in HTML5. Use CSS instead. |
|
Defines a footer for a document or section |
|
Defines an HTML form for user input |
|
Not supported in HTML5. |
|
Not supported in HTML5. |
|
Defines HTML headings |
|
Defines information about the document |
|
Defines a header for a document or section |
|
Defines a group of headings |
|
Defines a thematic change in the content |
|
Defines the root of an HTML document |
|
Defines a part of text in an alternate voice or mood |
|
Defines an inline frame |
|
Defines an image |
|
Defines an input control |
|
Defines a text that has been inserted into a document |
|
Defines keyboard input |
|
Defines a key-pair generator field (for forms) |
|
Defines a label for an <input> element |
|
Defines a caption for a <fieldset> element |
|
Defines a list item |
|
Defines the relationship between a document and an external resource (most used to link to style sheets) |
|
Specifies the main content of a document |
|
Defines a client-side image-map |
|
Defines marked/highlighted text |
|
Defines a list/menu of commands |
|
Defines a command/menu item that the user can invoke from a popup menu |
|
Defines metadata about an HTML document |
|
Defines a scalar measurement within a known range (a gauge) |
|
Defines navigation links |
|
Not supported in HTML5. |
|
Defines an alternate content for users that do not support client-side scripts |
|
Defines an embedded object |
|
Defines an ordered list |
|
Defines a group of related options in a drop-down list |
|
Defines an option in a drop-down list |
|
Defines the result of a calculation |
|
Defines a paragraph |
|
Defines a parameter for an object |
|
Defines preformatted text |
|
Represents the progress of a task |
|
Defines a short quotation |
|
Defines what to show in browsers that do not support ruby annotations |
|
Defines an explanation/pronunciation of characters (for East Asian typography) |
|
Defines a ruby annotation (for East Asian typography) |
|
Defines text that is no longer correct |
|
Defines sample output from a computer program |
|
Defines a client-side script |
|
Defines a section in a document |
|
Defines a drop-down list |
|
Defines smaller text |
|
Defines multiple media resources for media elements (<video> and <audio>) |
|
Defines a section in a document |
|
Not supported in HTML5. Use <del> instead. |
|
Defines important text |
|
Defines style information for a document |
|
Defines subscripted text |
|
Defines a visible heading for a <details> element |
|
Defines superscripted text |
|
Defines a table |
|
Groups the body content in a table |
|
Defines a cell in a table |
|
Defines a multiline input control (text area) |
|
Groups the footer content in a table |
|
Defines a header cell in a table |
|
Groups the header content in a table |
|
Defines a date/time |
|
Defines a title for the document |
|
Defines a row in a table |
|
Defines text tracks for media elements (<video> and <audio>) |
|
Not supported in HTML5. Use CSS instead. |
|
Defines text that should be stylistically different from normal text |
|
Defines an unordered list |
|
Defines a variable |
|
Defines a video or movie |
|
Defines a possible line-break |
= Attribute added in HTML5.
Attribute |
Description |
Specifies a shortcut key to activate/focus an element |
|
Specifies one or more classnames for an element (refers to a class in a style sheet) |
|
Specifies whether the content of an element is editable or not |
|
Specifies a context menu for an element. The context menu appears when a user right-clicks on the element |
|
Used to store custom data private to the page or application |
|
Specifies the text direction for the content in an element |
|
Specifies whether an element is draggable or not |
|
Specifies whether the dragged data is copied, moved, or linked, when dropped |
|
Specifies that an element is not yet, or is no longer, relevant |
|
Specifies a unique id for an element |
|
Specifies the language of the element's content |
|
Specifies whether the element is to have its spelling and grammar checked or not |
|
Specifies an inline CSS style for an element |
|
Specifies the tabbing order of an element |
|
Specifies extra information about an element |
|
Specifies whether the content of an element should be translated or not |
HTML 4 added the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on an element.
To learn more about programming events, please visit our JavaScript tutorial.
Below are the global event attributes that can be added to HTML elements to define event actions.
= New event attributes in HTML5.
Events triggered for the window object (applies to the <body> tag):
Attribute |
Value |
Description |
script |
Script to be run after the document is printed |
|
script |
Script to be run before the document is printed |
|
script |
Script to be run when the document is about to be unloaded |
|
onerror |
script |
Script to be run when an error occur |
script |
Script to be run when there has been changes to the anchor part of the a URL |
|
script |
Fires after the page is finished loading |
|
onmessage |
script |
Script to be run when the message is triggered |
script |
Script to be run when the browser starts to work offline |
|
script |
Script to be run when the browser starts to work online |
|
onpagehide |
script |
Script to be run when a user navigates away from a page |
script |
Script to be run when a user navigates to a page |
|
onpopstate |
script |
Script to be run when the window's history changes |
script |
Fires when the browser window is resized |
|
onstorage |
script |
Script to be run when a Web Storage area is updated |
script |
Fires once a page has unloaded (or the browser window has been closed) |
Events triggered by actions inside a HTML form (applies to almost all HTML elements, but is most used in form elements):
Attribute |
Value |
Description |
script |
Fires the moment that the element loses focus |
|
script |
Fires the moment when the value of the element is changed |
|
script |
Script to be run when a context menu is triggered |
|
script |
Fires the moment when the element gets focus |
|
script |
Script to be run when an element gets user input |
|
oninvalid |
script |
Script to be run when an element is invalid |
script |
Fires when the Reset button in a form is clicked |
|
script |
Fires when the user writes something in a search field (for <input="search">) |
|
script |
Fires after some text has been selected in an element |
|
script |
Fires when a form is submitted |
Attribute |
Value |
Description |
script |
Fires when a user is pressing a key |
|
script |
Fires when a user presses a key |
|
script |
Fires when a user releases a key |
Events triggered by a mouse, or similar user actions:
Attribute |
Value |
Description |
script |
Fires on a mouse click on the element |
|
script |
Fires on a mouse double-click on the element |
|
script |
Script to be run when an element is dragged |
|
script |
Script to be run at the end of a drag operation |
|
script |
Script to be run when an element has been dragged to a valid drop target |
|
script |
Script to be run when an element leaves a valid drop target |
|
script |
Script to be run when an element is being dragged over a valid drop target |
|
script |
Script to be run at the start of a drag operation |
|
script |
Script to be run when dragged element is being dropped |
|
script |
Fires when a mouse button is pressed down on an element |
|
script |
Fires when the mouse pointer is moving while it is over an element |
|
script |
Fires when the mouse pointer moves out of an element |
|
script |
Fires when the mouse pointer moves over an element |
|
script |
Fires when a mouse button is released over an element |
|
onmousewheel |
script |
Deprecated. Use the onwheel attribute instead |
script |
Script to be run when an element's scrollbar is being scrolled |
|
script |
Fires when the mouse wheel rolls up or down over an element |
Attribute |
Value |
Description |
script |
Fires when the user copies the content of an element |
|
script |
Fires when the user cuts the content of an element |
|
script |
Fires when the user pastes some content in an element |