tags, attributes, and event encyclopedia for HTML elements (including HTML5)

Source: Internet
Author: User
Tags unique id

1. Label List
label Description
<!–...–> Defines a comment.
<! Doctype> Defines the document type.
<a> Defines a hyperlink.
<abbr> Define abbreviations.
<acronym> Not supported in HTML 5. Defines the initials.
<address> Defines the address element.
<applet> Not supported in HTML 5. Defines an applet.
<area> Defines the area in the image map.
<article> Define article.
<aside> Define content beyond the content of the page.
<audio> Defines the sound content.
<b> Defines bold text.
<base> Defines the base URL for all links in the page.
<basefont> Not supported in HTML 5. Please use CSS instead.
<bdi> Defines the text orientation of the text so that it is set out of the direction of the text around it.
<bdo> Defines the direction in which the text is displayed.
<big> Not supported in HTML 5. Defines large text.
<blockquote> Defines a long reference.
<body> Defines the BODY element.
<br> Inserts a newline character.
<button> Defines the button.
<canvas> Define the graphic.
<caption> Defines the table title.
<center> Not supported in HTML 5. Defines the centered text.
<cite> Defines a reference.
<code> Defines the computer code text.
<col> Defines the properties of a table column.
<colgroup> Defines the grouping of table columns.
<command> Defines a command button.
<datalist> Defines a drop-down list.
<dd> A description of the definition definition.
<del> Defines the deletion text.
<details> Defines the details of the element.
<dfn> Define the definition of the project.
<dir> Not supported in HTML 5. Defines a list of directories.
<div> Defines a section in the document.
<dl> Defines a list of definitions.
<dt> Defines the defined project.
<em> Defines the accent text.
<embed> Define external interaction content or plug-ins.
<fieldset> Define FieldSet.
<figcaption> Defines the caption of a figure element.
<figure> Defines the grouping of media content, as well as their titles.
<font> Not supported in HTML 5.
<footer> Defines the footer of a section or page.
<form> Define the form.
<frame> Not supported in HTML 5. Defines a child window (frame).
<frameset> Not supported in HTML 5. Defines the set of frames.
Define Heading 1 to heading 6.
Defines information about the document.
Defines the header for a section or page.
Defines information about a section in a document.
Defines a horizontal line.
Defines an HTML document.
<i> defines italic text.
<iframe> Defines a child window (frame) within a row.
Define the image.
<input> Defines an input field.
<ins> Defines the insert text.
<keygen> Defines the build key.
<isindex> Not supported in HTML 5. Defines the input fields for a single line.
<kbd> Defines the keyboard text.
<label> Defines a callout for a form control.
<legend> Defines the caption in the fieldset.
<li> The item that defines the list.
<link> Defines a resource reference.
<map> Defines an image map.
<mark> Defines the marked text.
<menu> Defines a menu list.
<meta> Defines meta information.
<meter> Define measures within a predefined range.
<nav> Defines the navigation link.
<noframes> Not supported in HTML 5. Defines the Noframe section.
<noscript> Defines the NoScript section.
<object> Defines the embedded object.
<ol> Defines an ordered list.
<optgroup> Define an option group.
<option> Defines the options in the drop-down list.
<output> Defines some types of output.
<p> Defines a paragraph.
<param> Define parameters for the object.
<pre> Defines the pre-formatted text.
<progress> Defines the progress of any type of task.
<q> Defines a short reference.
<rp> Defines if the browser does not support the content displayed by the Ruby element.
<rt> Defines the interpretation of Ruby annotations.
<ruby> Define Ruby annotations.
<s> Not supported in HTML 5. Defines the text to add strikethrough to.
<samp> Define the sample computer code.
<script> Define the script.
<section> Defines a section.
<select> Defines an optional list.
<small> Renders the margin note (side comments) as small text.
<source> Defines the media source.
<span> Defines a section in a document.
<strike> Not supported in HTML 5. Defines the text to add strikethrough to.
<strong> Defines the accent text.
<style> Defines a style definition.
<sub> Defines the subscript text.
<summary> Defines the caption of the details element.
<sup> Defines the superscript text.
<table> Define the table.
<tbody> Defines the body of the table.
<td> Defines a table cell.
<textarea> Define TEXTAREA.
<tfoot> Defines a footnote to the table.
<th> Defines a table header.
<thead> Defines a table header.
<time> Defines the date/time.
<title> Defines the title of the document.
<tr> Defines a table row.
<track> Defines a text track used in a media player.
<tt> Not supported in HTML 5. Defines the typewriter text.
<u> Not supported in HTML 5. Defines the underlined text.
<ul> Defines an unordered list.
<var> Defines a variable.
<video> Define the video.
<xmp> Not supported in HTML 5. Defines the pre-formatted text.
2. HTML 5 Standard Properties
Properties value Description
AccessKey Character Specify keyboard shortcuts for accessing elements
Class ClassName The class name of the specified element (used to specify the class in the style sheet).
Contenteditable
  • True
  • False
Specifies whether users are allowed to edit content.
ContextMenu menu_id The context menu for the specified element.
Data-yourvalue Value The creator-defined property. The creator of an HTML document can define their own properties. Must start with "data-".
Dir
  • Ltr
  • Rtl
Specifies the text direction of the content in the element.
Draggable
  • True
  • False
  • Auto
Specifies whether the user is allowed to drag elements.
Hidden Hidden Specifies that the element is irrelevant. The hidden elements are not displayed.
Id Id The unique ID of the specified element.
Item
  • Empty
  • Url
Used to combine elements.
Itemprop
  • Url
  • Group value
Used to group items.
Lang Language_code The language code that specifies the contents of the element.
SpellCheck
  • True
  • False
Specifies whether the element must be checked for spelling or grammar.
Style Style_definition Specifies the inline style of the element.
Subject Id The item that corresponds to the specified element.
TabIndex Number Specifies the tab control order of the elements.
Title Text Specifies additional information about the element.
3. Global Event Properties

The following table lists the standard event properties that can be inserted into HTML elements to define event behavior.

    • Window Event Properties –window Event Attributes
    • Form Event –form Events
    • Keyboard Events –keybord Events
    • Mouse Events –mouse Events
    • Media Event –media Events
1) Window Event Properties

The event that is triggered by the Window object.

Applies to <body> Tags:

Properties value Description
Onafterprint Script Run a script after printing a document
Onbeforeprint Script Run a script before the document is printed
Onbeforeonload Script Run the script before the document is loaded
Onblur Script Run script when window loses focus
OnError Script Run a script when an error occurs
onfocus Script Run script when window gets focus
Onhaschange Script Run a script when the document changes
OnLoad Script Run a script when the document is loaded
OnMessage Script Run script when message is triggered
Onoffline Script Run scripts when documents are offline
Ononline Script Run a script when the document is online
Onpagehide Script Run script when window is hidden
Onpageshow Script Run script when window is visible
Onpopstate Script Run script when window history changes
Onredo Script Run the script when the document executes the action (redo)
OnResize Script Run the script when you resize the window for large hours
Onstorage Script Run script when document load is loaded
OnUndo Script When the Web Storage zone is updated (when the data in the storage space changes)
OnUnload Script Run a script when the user leaves the document
2) Form Events

An event that is triggered by an action inside an HTML form.

Properties value Description
Onblur Script Run script when element loses focus
OnChange Script Run the script when the element changes
OnContextMenu Script Run script when context menu is triggered
onfocus Script Run script when element gets focus
Onformchange Script Run the script when the form changes
Onforminput Script Run script when form gets user input
Oninput Script Run script when element gets user input
Oninvalid Script Run script when element is invalid
OnReset Script Run the script when the form is reset. HTML 5 is not supported.
Onselect Script Run a script when you select an element
OnSubmit Script Run a script when you submit a form
3) Keyboard Events

Events triggered by the keyboard.

Properties value Description
OnKeyDown Script Run the script when you press the key
onkeypress Script Run the script when you press and release the key
OnKeyUp Script Run the script when you release the key
4) Mouse Events

Events triggered by a mouse or similar user action.

Properties value Description
OnClick Script Run a script when you click the mouse
OnDblClick Script Run a script when you double-click the mouse
Ondrag Script Run a script when you drag an element
Ondragend Script Run script at the end of a drag operation
OnDragEnter Script Run a script when an element is dragged to a valid drag-and-drop target
OnDragLeave Script Run a script when an element leaves a valid drag-and-drop target
OnDragOver Script Run a script when an element is dragged over a valid drag-and-drop target
Ondragstart Script Run the script when the drag operation starts
OnDrop Script Run the script when the dragged element is being dragged and dropped
OnMouseDown Script Run script when mouse button is pressed
OnMouseMove Script Run a script when the mouse pointer moves
onmouseout Script Run a script when the mouse pointer moves out of the element
onmouseover Script Run script when mouse pointer moves above element
OnMouseUp Script Run a script when you release the mouse button
OnMouseWheel Script Run a script when you rotate the mouse wheel
Onscroll Script Run a script when scrolling an element's scroll bar
5) Media Events

Events triggered by media such as video, image, and audio.

Applies to all HTML 5 elements, but is most commonly used in media elements such as audio, Embed, IMG, object, and Video:

Properties value Description
Onabort Script Run script when abort event occurs
Oncanplay Script Run script when media is able to start playing but may need to stop because of buffering
Oncanplaythrough Script Run scripts when the media is able to play to the end without having to stop because of buffering
Ondurationchange Script Run scripts when media length changes
Onemptied Script Run a script when the media resource element suddenly is empty (network error, load error, and so on)
onended Script Run the script when the media has reached the end
OnError Script Run a script when an error occurs during element loading
Onloadeddata Script Run script when media data is loaded
Onloadedmetadata Script Run the script when the media element's duration and other media data is loaded
Onloadstart Script Run script when browser starts loading media data
OnPause Script Run script when media data is paused
Onplay Script Run script when media data is about to start playing
Onplaying Script Run script when media data has started playing
OnProgress Script Run a script when the browser is fetching media data
Onratechange Script Run the script when the playback rate of the media data changes
onReadyStateChange Script Run the script when the Ready state (Ready-state) changes
Onseeked Script Script is run when the positioning attribute [1] of the media element is no longer true and the positioning is ended
Onseeking Script Run the script when the Location property of the media element is true and positioning is started
Onstalled Script Run the script when there is an error in retrieving the media data (latency)
Onsuspend Script Run script when the browser is already fetching media data but stops before retrieving the entire media file
Ontimeupdate Script Run the script when the media changes its playback position
Onvolumechange Script Run the script when the media changes the volume or when the volume is set to mute
Onwaiting Script Run the script when the media has stopped playing but you intend to continue playing

tags, attributes, and event encyclopedia for HTML elements (including HTML5)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.