HTML Tag

HTML and JavaScript Coding Notes

Complete Reference Guide for Web Developers

Last Updated: 2021-09-25 Author: D Tech Vns Version: HTML5/JavaScript ES6+

Mouse Events

Events triggered by mouse actions

Attribute Value Description
ondragstart script Script to be run at the start of a drag operation
ondrop script Script to be run when dragged element is being dropped
onmousedown script Fires when a mouse button is pressed down on an element
onmousemove script Fires when the mouse pointer is moving while it is over an element
onmouseout script Fires when the mouse pointer moves out of an element
onmouseover script Fires when the mouse pointer moves over an element
onmouseup script Fires when a mouse button is released over an element
onmousewheel script Deprecated. Use the onwheel attribute instead
onscroll script Script to be run when an element's scrollbar is being scrolled
onwheel script Fires when the mouse wheel rolls up or down over an element

Clipboard Events

Events for copy, cut, and paste operations

Attribute Value Description
oncopy script Fires when the user copies the content of an element
oncut script Fires when the user cuts the content of an element
onpaste script Fires when the user pastes some content into an element

Media Events

Events triggered by media elements (audio, video, images)

Applies to: All HTML elements, but most common in media elements like <audio>, <embed>, <img>, <object>, and <video>

Attribute Value Description
onabort script Script to be run on abort
oncanplay script Script to be run when a file is ready to start playing
oncanplaythrough script Script to be run when a file can be played all the way to the end without pausing for buffering
oncuechange script Script to be run when the cue changes in <track> element
ondurationchange script Script to be run when the length of the media changes
onemptied script Script to be run when something bad happens and the file is suddenly unavailable
onended script Script to be run when the media has reached the end
onerror script Script to be run when an error occurs when the file is being loaded
onloadeddata script Script to be run when media data is loaded
onloadedmetadata script Script to be run when metadata (like dimensions and duration) are loaded
onloadstart script Script to be run just as the file begins to load before anything is actually loaded
onpause script Script to be run when the media is paused either by the user or programmatically
onplay script Script to be run when the media is ready to start playing
onplaying script Script to be run when the media actually has started playing
onprogress script Script to be run when the browser is in the process of getting the media data
onratechange script Script to be run each time the playback rate changes
onseeked script Script to be run when seeking attribute is set to false indicating that seeking has ended
onseeking script Script to be run when the seeking attribute is set to true indicating that seeking is active
onstalled script Script to be run when the browser is unable to fetch the media data for whatever reason
onsuspend script Script to be run when fetching the media data is stopped before it is completely loaded
ontimeupdate script Script to be run each time the volume is changed (includes setting the volume to "mute")
onwaiting script Script to be run when the media has paused but is expected to resume

Miscellaneous Events

Other important events

Attribute Value Description
onerror script Fires when an error occurs while loading an external file
onshow script Fires when a <menu> element is shown as a context menu
ontoggle script Fires when the user opens or closes the <details> element

HTML Tags Ordered by Category

Complete list of HTML tags organized by category

Formatting Tags

<font> Deprecated

Not supported in HTML5. Use CSS instead. Defines font, color, and size for text

<i> HTML5

Defines a part of text in an alternate voice or mood

<ins> HTML5

Defines text that has been inserted into a document

<kbd> HTML5

Defines keyboard input

<mark> HTML5

Defines marked/highlighted text

<meter> HTML5

Defines a scalar measurement within a known range (a gauge)

<pre> HTML5

Defines preformatted text

<progress> HTML5

Represents the progress of a task

<q> HTML5

Defines a short quotation

<rp> HTML5

Defines what to show in browsers that do not support ruby annotations

<rt> HTML5

Defines an explanation/pronunciation of characters (for East Asian typography)

<ruby> HTML5

Defines a ruby annotation (for East Asian typography)

<s> HTML5

Defines text that is no longer correct

<samp> HTML5

Defines sample output from a computer program

<small> HTML5

Defines smaller text

<strike> Deprecated

Not supported in HTML5. Use <del> instead. Defines strikethrough text

<strong> HTML5

Defines important text

<sub> HTML5

Defines subscripted text

<time> HTML5

Defines a date/time

<tt> Deprecated

Not supported in HTML5. Use CSS instead. Defines teletype text

<u> HTML5

Defines text that should be stylistically different from normal text

<var> HTML5

Defines a variable

<wbr> HTML5

Defines a possible line-break

Basic Tags - New in HTML5

<!DOCTYPE> Essential

Defines the document type

<html> Essential

Defines an HTML document

<title> Essential

Defines a title for the document

<body> Essential

Defines the document's body

<h1> to <h6> Essential

Defines HTML headings

<p> Essential

Defines a paragraph

<br> Essential

Inserts a single line break

<hr> HTML5

Defines a thematic change in the content

<!--...--> Essential

Defines a comment

Additional Formatting Tags

<acronym> Deprecated

Not supported in HTML5. Use <abbr> instead. Defines an acronym

<abbr> HTML5

Defines an abbreviation or an acronym

<address> HTML5

Defines contact information for the author/owner of a document/article

<b> HTML5

Defines bold text

<bdi> HTML5

Isolates a part of text that might be formatted in a different direction from other text

<bdo> HTML5

Overrides the current text direction

<big> Deprecated

Not supported in HTML5. Use CSS instead. Defines big text

<blockquote> HTML5

Defines a section that is quoted from another source

<center> Deprecated

Not supported in HTML5. Use CSS instead. Defines centered text

<cite> HTML5

Defines the title of a work

<code> HTML5

Defines a piece of computer code

<del> HTML5

Defines text that has been deleted from a document

<dfn> HTML5

Represents the defining instance of a term

<em> HTML5

Defines emphasized text

Download Complete Notes (PDF)

Includes all HTML tags, JavaScript events, and coding examples