HTML Cheat Sheet

This HTML cheat sheet includes all HTML5 elements, their attributes, and their DOM interface.

Element Description Attributes DOM Interface New in HTML5?
<!--...--> Specifies a comment None    
<!DOCTYPE>  Specifies the document type None    
<a> Specifies a hyperlink Global Attributes; Event Handlers; href; target; download; rel; hreflang; type HTMLAnchorElement  
<abbr> Specifies an abbreviation Global Attributes; Event Handlers; HTMLElement  
<address> Specifies an address element Global Attributes; Event Handlers; HTMLElement  
<area> Specifies an area inside an image map Global Attributes; Event Handlers; alt; coords; shape; href; target; download; rel; hreflang; type HTMLAreaElement  
<article> Specifies an article Global Attributes; Event Handlers; HTMLElement NEW
<aside> Specifies content aside from the page content Global Attributes; Event Handlers; HTMLElement NEW
<audio> Specifies sound content Global Attributes; Event Handlers; src; crossorigin; preload; autoplay; mediagroup; loop; muted; controls HTMLAudioElement NEW
<b> Specifies bold text Global Attributes; Event Handlers; HTMLElement  
<base> Specifies a base URL for all the links in a page Global Attributes; Event Handlers; href; target HTMLBaseElement  
<bdi> For bi-directional text formatting Global Attributes; Event Handlers; HTMLElement NEW
<bdo> Specifies the direction of text display Global Attributes; Event Handlers; HTMLElement  
<blockquote> Specifies a long quotation Global Attributes; Event Handlers; cite HTMLQuoteElement  
<body> Specifies the body element Global Attributes; Event Handlers; onafterprint; onbeforeprint; onbeforeunload; onhashchange; onmessage; onoffline; ononline; onpagehide; onpageshow; onpopstate; onstorage; onunload HTMLBodyElement  
<br> Inserts a single line break Global Attributes; Event Handlers; HTMLBRElement  
<button> Specifies a push button Global Attributes; Event Handlers; autofocus; disabled; form; formaction; formenctype; formmethod; formnovalidate; formtarget; name; type; value HTMLButtonElement  
<canvas> Define graphics Global Attributes; Event Handlers; width; height HTMLCanvasElement NEW
<caption> Specifies a table caption Global Attributes; Event Handlers; HTMLTableCaptionElement  
<cite> Specifies a citation Global Attributes; Event Handlers; HTMLElement  
<code> Specifies computer code text Global Attributes; Event Handlers; HTMLElement  
<col> Specifies attributes for table columns  Global Attributes; Event Handlers; span HTMLTableColElement  
<colgroup> Specifies groups of table columns Global Attributes; Event Handlers; span HTMLTableColElement  
<data> Allows for machine-readable data to be provided Global Attributes; Event Handlers; value HTMLDataElement NEW
<datalist> Specifies an "autocomplete" dropdown list Global Attributes; Event Handlers; HTMLDataListElement NEW
<dd> Specifies a definition description Global Attributes; Event Handlers; HTMLElement  
<del> Specifies deleted text Global Attributes; Event Handlers; cite; datetime HTMLModElement  
<details> Specifies details of an element Global Attributes; Event Handlers; open HTMLDetailsElement NEW (HTML5.1)
<dfn> Defines a definition term Global Attributes; Event Handlers; HTMLElement  
<dialog> Specifies that part of an application is interactive. Global Attributes; Event Handlers; open HTMLDialogElement NEW
<div> Specifies a section in a document Global Attributes; Event Handlers; HTMLDivElement  
<dl> Specifies a definition list Global Attributes; Event Handlers; HTMLDListElement  
<dt> Specifies a definition term Global Attributes; Event Handlers; HTMLElement  
<em> Specifies emphasized text  Global Attributes; Event Handlers; HTMLElement  
<embed> Specifies external application or interactive content Global Attributes; Event Handlers; src; type; width; height; HTMLEmbedElement NEW
<fieldset> Specifies a fieldset Global Attributes; Event Handlers; disabled; form; name HTMLFieldSetElement  
<figcaption> Specifies caption for the figure element. Global Attributes; Event Handlers; HTMLElement NEW
<figure> Specifies a group of media content, and their caption Global Attributes; Event Handlers; HTMLElement NEW
<footer> Specifies a footer for a section or page Global Attributes; Event Handlers; HTMLElement NEW
<form> Specifies a form  Global Attributes; Event Handlers; accept-charset; action; autocomplete; enctype; method; name; novalidate; target HTMLFormElement  
<h1> Specifies a heading level 1 Global Attributes; Event Handlers; HTMLHeadingElement  
<h2> Specifies a heading level 2 Global Attributes; Event Handlers; HTMLHeadingElement  
<h3> Specifies a heading level 3 Global Attributes; Event Handlers; HTMLHeadingElement  
<h4> Specifies a heading level 4 Global Attributes; Event Handlers; HTMLHeadingElement  
<h5> Specifies a heading level 5 Global Attributes; Event Handlers; HTMLHeadingElement  
<h6> Specifies a heading level 6 Global Attributes; Event Handlers; HTMLHeadingElement  
<head> Specifies information about the document Global Attributes; Event Handlers; HTMLHeadElement  
<header> Specifies a group of introductory or navigational aids, including hgroup elements Global Attributes; Event Handlers; HTMLElement NEW
<hgroup> Specifies a header for a section or page.

NOTE: This element has been dropped from W3C HTML5 spec but it is still included in WHATWG Living Standard.

Global Attributes; Event Handlers; HTMLElement NEW
<hr> Specifies a horizontal rule Global Attributes; Event Handlers; HTMLHRElement  
<html> Specifies an html document Global Attributes; Event Handlers; manifest HTMLHtmlElement  
<i> Specifies italic text Global Attributes; Event Handlers; HTMLElement  
<iframe> Specifies an inline sub window (frame) Global Attributes; Event Handlers; src; srcdoc; name; sandbox; width; height HTMLIFrameElement  
<img> Specifies an image Global Attributes; Event Handlers; alt; src; crossorigin; usemap; ismap; width; height HTMLImageElement  
<input> Specifies an input field Global Attributes; Event Handlers; accept; alt; autocomplete; autofocus; checked; dirname; disabled; form; formaction; formenctype; formmethod; formnovalidate; formtarget; height; list; max; maxlength; min; minlength; multiple; name; pattern; placeholder; readonly; required; size; src; step; type; value; width HTMLInputElement  
<ins> Specifies inserted text Global Attributes; Event Handlers; cite; datetime HTMLModElement  
<kbd> Specifies keyboard text Global Attributes; Event Handlers; HTMLElement  
<label> Specifies a label for a form control Global Attributes; Event Handlers; form; for HTMLLabelElement  
<legend> Specifies a title in a fieldset Global Attributes; Event Handlers; HTMLLegendElement  
<li> Specifies a list item Global Attributes; Event Handlers; value HTMLLIElement  
<link> Specifies a resource reference Global Attributes; Event Handlers; href; crossorigin; rel; media; hreflang; type; sizes HTMLLinkElement  
<main> Specifies the main content area of an HTML document. Global Attributes; Event Handlers; HTMLElement NEW
<map> Specifies an image map  Global Attributes; Event Handlers; name HTMLMapElement  
<mark> Specifies marked text Global Attributes; Event Handlers; HTMLElement NEW
<menu> Specifies a menu list Global Attributes; Event Handlers; type; label; HTMLMenuElement NEW (HTML 5.1)
<menuitem> Specifies a command that a user can invoke from a popup menu. Global Attributes; Event Handlers; type; label; icon; disabled; checked;; radiogroup; default; command HTMLMenuItemElement NEW (HTML 5.1)
<meta> Specifies meta information Global Attributes; Event Handlers; name; http-equiv; content; charset HTMLMetaElement  
<meter> Specifies measurement within a predefined range Global Attributes; Event Handlers; value; min; max; low; high; optimum HTMLMeterElement NEW
<nav> Specifies navigation links Global Attributes; Event Handlers; HTMLElement NEW
<noscript> Specifies a noscript section Global Attributes; Event Handlers; HTMLElement  
<object> Specifies an embedded object Global Attributes; Event Handlers; data; type; typemustmatch; name; usemap; form; width; height HTMLObjectElement  
<ol> Specifies an ordered list Global Attributes; Event Handlers; reversed; start; type HTMLOListElement  
<optgroup> Specifies an option group Global Attributes; Event Handlers; disabled; label HTMLOptGroupElement  
<option> Specifies an option in a drop-down list Global Attributes; Event Handlers; disabled; label; selected; value HTMLOptionElement  
<output> Specifies some types of output Global Attributes; Event Handlers; for; form; name HTMLOutputElement NEW
<p> Specifies a paragraph Global Attributes; Event Handlers; HTMLParagraphElement  
<param> Specifies a parameter for an object Global Attributes; Event Handlers; name; value HTMLParamElement  
<pre> Specifies preformatted text Global Attributes; Event Handlers; HTMLPreElement  
<progress> Specifies progress of a task of any kind Global Attributes; Event Handlers; value; max HTMLProgressElement NEW
<q> Specifies a short quotation Global Attributes; Event Handlers; cite HTMLQuoteElement  
<rb> Marks the base text component of a ruby annotation. Global Attributes; Event Handlers; NEW
<rp> Used for the benefit of browsers that don't support ruby annotations Global Attributes; Event Handlers; HTMLElement NEW
<rt> Specifies the ruby text component of a ruby annotation. Global Attributes; Event Handlers; HTMLElement NEW
<rtc> Marks a ruby text container for ruby text components in a ruby annotation. Global Attributes; Event Handlers; HTMLElement NEW
<ruby> Specifies a ruby annotation (used in East Asian typography) Global Attributes; Event Handlers; HTMLElement NEW
<s> Indicates text that's no longer accurate or relevant. Global Attributes; Event Handlers; HTMLElement  
<samp> Specifies sample computer code Global Attributes; Event Handlers; HTMLElement  
<script> Specifies a script Global Attributes; Event Handlers; src; type; charset; async; defer; crossorigin HTMLScriptElement  
<section> Specifies a section Global Attributes; Event Handlers; HTMLElement NEW
<select> Specifies a selectable list Global Attributes; Event Handlers; autofocus; disabled; form; multiple; name; required; size HTMLSelectElement  
<small> Specifies small text Global Attributes; Event Handlers; HTMLElement  
<source> Specifies media resources Global Attributes; Event Handlers; src; type; media HTMLSourceElement NEW
<span> Specifies a section in a document Global Attributes; Event Handlers; HTMLSpanElement  
<strong> Specifies strong text Global Attributes; Event Handlers; HTMLElement  
<style> Specifies a style definition Global Attributes; Event Handlers; media; type HTMLStyleElement  
<sub> Specifies subscripted text Global Attributes; Event Handlers; HTMLElement  
<summary> Specifies a summary / caption for the <details> element Global Attributes; Event Handlers; HTMLElement NEW (HTML 5.1)
<sup> Specifies superscripted text Global Attributes; Event Handlers; HTMLElement  
<table> Specifies a table Global Attributes; Event Handlers; border HTMLTableElement  
<tbody> Specifies a table body Global Attributes; Event Handlers; HTMLTableSectionElement  
<td> Specifies a table cell Global Attributes; Event Handlers; HTMLTableDataCellElement  
<template> Declares HTML fragments that can be cloned and inserted in the document by script. Global Attributes; Event Handlers; HTMLTemplateElement NEW
<textarea> Specifies a text area Global Attributes; Event Handlers; autofocus; cols; dirname; disabled; form; maxlength; minlength; name; placeholder; readonly; required; rows; wrap HTMLTextAreaElement  
<tfoot> Specifies a table footer Global Attributes; Event Handlers; HTMLTableSectionElement  
<th> Specifies a table header Global Attributes; Event Handlers; colspan; rowspan; headers; scope; abbr HTMLTableHeaderCellElement  
<thead> Specifies a table header Global Attributes; Event Handlers; HTMLTableSectionElement  
<time> Specifies a date/time Global Attributes; Event Handlers; datetime HTMLTimeElement NEW
<title> Specifies the document title Global Attributes; Event Handlers; HTMLTitleElement  
<tr> Specifies a table row Global Attributes; Event Handlers; HTMLTableRowElement  
<track> Specifies a text track for media such as video and audio Global Attributes; Event Handlers; default; kind; label; src; srclang HTMLTrackElement NEW
<u> Specifies text with a non-textual annotation. Global Attributes; Event Handlers; HTMLElement  
<ul> Specifies an unordered list Global Attributes; Event Handlers; HTMLUListElement  
<var> Specifies a variable Global Attributes; Event Handlers; HTMLElement  
<video> Specifies a video Global Attributes; Event Handlers; src; crossorigin; poster; preload; autoplay; mediagroup; loop; muted; controls; width; height HTMLVideoElement NEW
<wbr> Specifies a line break opportunity for very long words and strings of text with no spaces. Global Attributes; Event Handlers; HTMLElement NEW