References

Collection of references for web development.

HTML Reference

Below is a list of all available tags and attributes for HTML (HyperText Markup Language), our list does not provide deprecated methods as these should not be used on the modern web.

You need to learn HTML if you want to create websites, HTML is the structure of a web page, you will also need basic understand with CSS and JavaScript.

Tags

Name Description
!-- The HTML <!--...--> Tag represents commented text in the source code of the document, this will not be rendered by the browser, you can only see comments by looking at the source code, useful for development purposes.
!DOCTYPE The HTML <!DOCTYPE> Tag must be the first tag you declare in your document, it tells the browser what version of HTML the document is written in.
a The HTML <a> (anchor) element is used for creating hyperlinks to websites, files, or locations on a document.
abbr The HTML <abbr> element represents an abbreviation and optionally a title.
address The HTML <address> element represents the contact information for the document.
area The HTML <area> element is a child of the <map> element, it defines an hot-spot region on the image and optionally used as creating links.
article The HTML <article> element identifies the content which could be used as a stand-alone unit, which could be distributable or reusable. This could be a blog post, newspaper article, forum post, or any other independent content.
aside The HTML <aside> element represents a section that is related to the content around it in the document. For example, the element could be used for a sidebar.
audio The HTML <audio> element is used to embed sound in the document.
b The HTML <b> element renders the specific text in boldface.
base The HTML <base> element represents the base URL to be used for all URLs in a document.
bdi The HTML <bdi> element isolates part of a text that may be formatted in a different direction from text outside of it.
bdo The HTML <bdo> element represents overridden text that can be displayed from left-to-right and right-to-left.
blockquote The HTML <blockquote> element represent text that is quoted from another source.
body The HTML <body> element contains the content for the HTML document.
br The HTML <br> element inserts a new line break into the specified content.
button The HTML <button> element represents a clickable button.
canvas The HTML <canvas> element is used to draw graphics with JavaScript.
caption The HTML <caption> element is used to define a caption for a table, this should only be used within a table.
cite The HTML <cite> element defines a reference of a work.
code The HTML <code> element is used to represent computer code.
col The HTML <col> element specifies cell properties, usually appears in the <colgroup> element.
colgroup The HTML <colgroup> element specifies a group of columns within a table.
data The HTML <data> element links the given content with a machine-readable language.
datalist The HTML <datalist> element represents a set of pre-defined options for an <input> element.
dd The HTML <dd> element is used to describe a term in a description list.
del The HTML <del> element represents deleted text.
details The HTML <del> element represents additional information to the user, the user has the choice to hide the information.
dfn The HTML <dfn> element represents the defining instance of a term.
dialog The HTML <dialog> element represents a dialog box or interactive window.
div The HTML <div> element represents a container for other HTML elements.
dl The HTML <dl> element represents a description list.
dt The HTML <dt> element is used to describe a term in a description list.
em The HTML <em> element marks text that has stress emphasis, the text is displayed in italics by the browser.
embed The HTML <embed> element represents a container for an external application or interactive content (e.g. a plug-in).
fieldset The HTML <fieldset> element is used to group related elements in a form.
figcaption The HTML <figcaption> element represents a caption for a <figure> element.
figure The HTML <figure> element represents self-contained content, this could be used for illustrations, diagrams, photos, etc.
footer The HTML <footer> element represents a footer for a document or section.
form The HTML <form> element represents a section in the document that contains interactive elements, commonly used to submit information to a web server.
h1 The HTML <h1>-<h6> elements represents a heading, <h1> being the highest and <h6> being the lowest. You should only use one <h1> tag per section.
h2 The HTML <h1>-<h6> elements represents a heading, <h1> being the highest and <h6> being the lowest.
h3 The HTML <h1>-<h6> elements represents a heading, <h1> being the highest and <h6> being the lowest.
h4 The HTML <h1>-<h6> elements represents a heading, <h1> being the highest and <h6> being the lowest.
h5 The HTML <h1>-<h6> elements represents a heading, <h1> being the highest and <h6> being the lowest.
h6 The HTML <h1>-<h6> elements represents a heading, <h1> being the highest and <h6> being the lowest.
head The HTML <head> element is a container, it contains information that is not displayed in your web browsers document e.g. page title, favicons, metadata, and links to external resources.
header The HTML <header> element represents a container for introductory content or navigational aids. The content normally consists of headers, images and paragraphs. The <header> element cannot be placed within the <address>, <footer>, or another <header> element.
hr The HTML <hr> element represents a thematic break between elements in the HTML document, this is displayed as a horizontal line.
html The HTML <html> element represents the root of an HTML document, all over elements must be descendants of this element.
i The HTML <i> element represents a range of text that is different from the normal text, the text is typically displayed italic. The <i> element can be used to show technical terms, foreign language phrases, opinions, etc.
iframe The HTML <iframe> element represents an inline frame, which embeds another HTML document into the current document.
img The HTML <img> element is used for embedding images in a HTML document.
input The HTML <input> element is used to create controls for forms, it allows the user to input data and optionally submit to a server.
ins The HTML <ins> element represents text that has been inserted into the HTML document.
kbd The HTML <kbd> element represents keyboard input, or text that should be entered with a device.
label The HTML <label> element represents a label to add to form controls, for example this could be used to describe an input box.
legend The HTML <legend> element represents a title or caption for describing its parent <fieldset> contents.
li The HTML <li> element represents an item in a list element, the item must be contained in an <ol>, <ul>, or a <menu> element.
link The HTML <link> element represents a link to an external resource, commonly used to link to cascading style sheets (CSS).
main The HTML <main> element represents the main content of a document, the content inside the element should be different from the outside content, for example this could include articles or posts but shouldn't contain content that is going to be repeated across pages, this could be the websites search bar, navigation, footer, etc.
map The HTML <map> element represents an image map, used in conjunction with <area> to define clickable regions.
mark The HTML <mark> element represents marked/highlighted text, commonly used for reference purposes.
meta The HTML <meta> element represents additional information about the document that is not visible to the user, this information is commonly stored in the <head> section of a document.
meter The HTML <meter> element represents a ranged scalar, used commonly to display factors such as disk usage, temperatures, etc.
nav The HTML <nav> element represents a container to be used for navigation links.
noscript The HTML <noscript> element represents code to display if the browser does not support scripting (JavaScript etc).
object The HTML <object> element represents a embedded object, used to embed external resources such as Java applets, flash files, PDF files, etc.
ol The HTML <ol> element represents an ordered list. The list can be numerical or alphabetical.
optgroup The HTML <optgroup> element represents a group of options in a <select> element.
option The HTML <option> element represents an option in a <select>, <datalist>, or <optgroup> element.
output The HTML <output> element represents the result of a calculation.
p The HTML <p> element represents a paragraph.
param The HTML <param> element represents parameters for the <object> element.
picture The HTML <picture> element represents a container used for specifying one or more image resources, commonly used to serve the same image but at different sizes for different devices.
pre The HTML <pre> element represents preformatted text, it preserves both spaces and line breaks.
progress The HTML <progress> element represents the progress of a task, commonly displayed as a progress bar.
q The HTML <q> element represents a short quotation.
rp The HTML <rp> element defines a fallback parentheses for browsers that do not support ruby annotations.
rt The HTML <rt> element represents an explanation in a ruby annotation.
rtc The HTML <rtc> element represents a ruby text container.
ruby The HTML <ruby> element represents a ruby annotation.
s The HTML <s> element represents text that is no longer relevant, usually displayed as text with a line through the middle.
samp The HTML <samp> element represents sample text from a computer program.
script The HTML <script> element represents client-side script (JavaScript).
section The HTML <section> element represents a section, commonly used to define sections in a document that contain headings, paragraphs, images, etc.
select The HTML <select> element represents a drop-down list.
small The HTML <small> element represents smaller text (one font size smaller than the original).
source The HTML <source> element represents multiple media resources for the <audio>, <picture>, or <video> element.
span The HTML <span> element represents an inline container. There is no default styling added to this element, its purpose is to be used as a container, similar to that of a <div> but can only contain inline elements.
strong The HTML <strong> element represents important text, commonly displayed in bold type.
style The HTML <style> element represents style information for a document.
sub The HTML <sub> element represents subscript text, commonly displayed in a lowered level smaller font.
summary The HTML <summary> element represents the heading used for a <details> element. The heading can then be clicked to view or hide the details.
sup The HTML <sup> element represents superscript text. Commonly displayed as a raised level smaller font text.
table The HTML <table> element represents a table that consists of rows and columns.
tbody The HTML <tbody> element represents a group of table elements used for body section of the <table> element.
td The HTML <td> element represents a table cell.
template The HTML <template> element represents a container that is hidden from the client, often used with JavaScript.
textarea The HTML <textarea> element represents a multi-line text input control.
tfoot The HTML <tfoot> element represents a group of table elements used for footer section of the <table> element.
th The HTML <th> element represents a header cell.
thead The HTML <thead> element represents a group of table elements used for head section of the <table> element.
time The HTML <time> element represents the date/time, often used with the <article> element.
title The HTML <title> element represents the title of the document, this element is required for all documents.
tr The HTML <tr> element represents a table row.
track The HTML <track> element represents tracks for the media elements <audio> and <video>.
u The HTML <u> element represents inline text, normally renders as underlined text.
ul The HTML <ul> element represents an unordered list.
var The HTML <var> element represents a variable, often used to present mathematical or programming expressions.
video The HTML <video> element represents an embedded video, the <video> element only supports the ogg, mp4 and webm formats.
wbr The HTML <wbr> element represents a Word Break Opportunity, specifies where a line break should occur.

Global Attributes

Name Description
accesskey Specifies the shortcut key to focus elements in the document.
class Specifies multiple classnames for an element, often used for styling the element with CSS.
contenteditable Specifies whether the element is editable or not.
data Specifies custom data for an element, you can use multiple data attributes.
dir Specifies the text direction of the elements content.
draggable Specifies whether the element is draggable or not.
dropzone Specifies what type of dragged content can be dropped on the element.
hidden Specifies whether the element is hidden or visible.
id Specifies the unique id for an element, all id's should be unique and not to be reused for multiple elements.
itemid Specifies the unique item id.
itemprop Specifies the property for an item.
itemref Specifies the list of element id's with additional properties.
itemscope Specifies whether an element should be a new item or not.
itemtype Specifies the vocabulary to which the item relates to.
lang Specifies the language of the element.
spellcheck Specifies if the elements value should have its spelling and grammar checked.
style Specifies the inline style for the element.
tabindex Specifies the position of the navigation tabbing in the document.
title Specifies a title for the element.
translate Specifies whether the element should be translated or not.

Specific Attributes

Name Description
accept Specifies the type of file the server accepts.
accept-charset Specifies a comma-separated list of character encodings that the server accepts.
action Specifies where to send the form information when it's submitted.
allowfullscreen Specifies whether the iframe is allowed to be in fullscreen mode or not.
alt Alternative text string to display on browsers that do not display images. The alt is required if the href attribute is used.
as Specifies the type of content for the link, can only be used if the content is being preloaded.
async Specifies if the script is executed asynchronously.
autocomplete Specifies if form elements should be automatically completed by the browser.
autofocus Specifies if the element should automatically have focus when the document loads.
autoplay Specifies whether the media source should automatically play or not.
buffered Determines which time ranges of the media have been buffered.
capture Specifies if the control should use capture for media devices.
charset Specifies the character encoding used for the document.
checked Specifies the check state of the element, default is checked or else ignore.
cite Specifies the source of the quotation or the resource that explains the change of the source.
cols Specifies the width of the textarea, default is 20.
colspan Specifies the amount of columns the cell extends.
content Specifies the content for the element.
controls Specifies whether the browser should show controls for the user.
coords Values specifying the coordinates on the hot-spot region.
crossorigin Allow data from third-party websites that allow cross-origin access so you can reuse it.
data Specifies the URL to the external resource.
datetime Specifies the date and time.
decoding Specifies the decoding hint that is sent to the browser.
default Specifies the default track to be used if the user's preference is not appropriate.
defer Specifies if the script should execute when the document has finished parsing.
dir Specifies the direction of the text.
disabled Specifies whether the element should be disabled or not (user is unable to click or control if disabled).
download Download a URL instead of navigating to it.
enctype Specifies the MIME type used when posting the form information to a server.
for Specifies the ID of the element that the label element is related to.
form Specifies the form(s) that the element belongs to.
formaction Specifies where to send the data.
formenctype Specifies what type of content is used when submitting the data. Type=submit only!
formmethod Specifies what method to use when submitting the data. Type=submit only!
formnovalidate Specifies that the data should not be validated on submit. Type=submit only!
formtarget Specifies where to display the response that is received after submitting the data. Type=submit only!
headers Specifies the headers that the element relates to.
height Specifies the height of the element, default is measured in pixels.
high Specifies the high end of the ranged value.
href Determines the URL to where the link will point to or the name of the anchor.
hreflang The language code for the destination URL.
http-equiv Specifies the HTTP header for the content attribute.
integrity Specifies inline metadata that the browser checks for manipulation.
ismap Specifies whether the image is part of a map or not.
kind Specifies what kind the track is.
label Specifies the name or meaning of the element.
label Specifies the label for the track.
list Specifies a pre-defined list of suggestions to the user.
longdesc Specifies the URL to a detailed description of the image.
loop If true, the media will continuously start from beginning when it has reached its end.
low Specifies the low end of the ranged value.
max Specifies the maximum value for this element.
maxlength Specifies the maximum number of characters a user can enter.
media Specifies the media type for which the element or the document is designed for.
method Specifies the HTTP method used when submitting the form.
min Specifies the minimum value for this element.
minlength Specifies the minimum number of characters a user can enter.
multiple Specifies whether the user can enter more than one value.
muted Specifies whether the media should be silenced or not.
name Specifies the name of the element.
name Specifies the name of the element, its associated with the content attribute.
nonce Specifies the number used once to white-list for the scripts policy.
novalidate Specifies whether the form should be validated or not.
open Specifies whether the element should be visible to the user.
optimum Specifies the preferred end of the ranged value.
pattern Specifies the regular expression that the element is checked against.
ping Notifies the list of specified URLs with a short HTTP POST, used typically for tracking.
placeholder Specifies a hint that describes the expected value.
played Determines the time ranges of the media that have been played.
playsinline Specifies whether the video should be played inline or not.
poster Specifies the image to display before the user plays the video.
preload Specifies how the author will think how the media should be loaded.
readonly Specifies if the user can modify the element.
rel Specifies the relationship between the current and target documents.
required Specifies that the elements value is required before submitting the form.
reversed Specifies whether the content should be reversed or not.
rows Specifies the number of lines for the element.
rowspan Specifies the amount of rows the cell extends.
sandbox Specifies an extra set of restrictions for the iframe.
scope Specifies whether the header cell relates to a column, row, or group of column or rows.
selected Specifies whether the option is selected or not.
selectionDirection Specifies the selection direction.
selectionEnd Specifies the offset of the last selected character.
selectionStart Specifies the offset of the first selected character.
shape The shape of the hot-spot region.
size Specifies the size of the element.
sizes Specifies image sizes for different document sizes.
span Specifies the number of columns the col elements spans.
src The URL of the file to embed in the document.
srcdoc Specifies the HTML content to show in the iframe.
srclang Specifies the language of the source.
srcset Specifies a list of resources to be used for different conditions.
start Specifies the start value for numbering the list.
step Specifies the intervals for the min and max attributes.
target Specifies where to display the URL.
text Specifies the text for the element.
type Specifies the media type for the URL.
type Specifies the type of the button.
type Specifies the type of the input control.
type Specifies the numbering type.
type Specifies the content type for the external resource.
typemustmatch Specifies if the type and the external resource content type should match.
usemap Specifies the image map associated with the element.
value Specifies the value of the element.
volume Specifies the playback volume, from silent to loudest.
width Specifies the width of the element, default is measured in pixels.
wrap Specifies how the control wraps the text.
xmlns Specifies the xml namespace for the document.

Events

Name Description
onabort Execute JavaScript code when on abort.
onafterprint Execute JavaScript code after the user has printed the document.
onanimationcancel Execute JavaScript code when the elements animation (CSS) unexpectedly aborts.
onanimationend Execute JavaScript code when the elements animation (CSS) has ended.
onanimationiteration Execute JavaScript code when the elements animation (CSS) reaches the end of the iteration.
onbeforeprint Execute JavaScript code before the user has printed the document.
onbeforeunload Execute JavaScript code before the document is unloaded.
onblur Execute JavaScript code when the document has lost focus.
oncanplay Execute JavaScript code when the source has been buffered enough for the user to play.
oncanplaythrough Execute JavaScript code when the source can be played all the way through, until the end.
onchange Execute JavaScript code when the value has changed.
onclick Execute JavaScript code when the user clicks the mouse button on the element.
oncontextmenu Execute JavaScript code when the user opens the context menu (right-click menu).
oncopy Execute JavaScript code when the user copies the elements content.
oncuechange Execute JavaScript code when the cue changes.
oncut Execute JavaScript code when the user cuts the elements content.
ondblclick Execute JavaScript code when the user double-clicks the mouse button on the element.
ondrag Execute JavaScript code when the user drags the element.
ondragend Execute JavaScript code when the user has stopped dragging the element.
ondragenter Execute JavaScript code when the user drags the element to a drop target.
ondragleave Execute JavaScript code when the user drags the element away from a drop target.
ondragover Execute JavaScript code when the user drags the element over a drop target.
ondragstart Execute JavaScript code before the user starts to drag the element.
ondrop Execute JavaScript code when the user has dropped the element.
ondurationchange Execute JavaScript code when the duration of the source file changes.
onemptied Execute JavaScript code if the source becomes unavailable, or corrupt.
onended Execute JavaScript code when the source has ended.
onerror Execute JavaScript code when the document fails to load.
onfocus Execute JavaScript code when the document receives focus.
onhashchange Execute JavaScript code when the documents URL hash tag text has changed.
oninput Execute JavaScript code when the user inputs text.
oninvalid Execute JavaScript code when the element is invalid.
onkeydown Execute JavaScript code when the user is pressing button.
onkeypress Execute JavaScript code when the user presses a key.
onkeyup Execute JavaScript code when the user releases a key.
onload Execute JavaScript code when the document has finished loading.
onloadeddata Execute JavaScript code when the data has been loaded.
onloadedmetadata Execute JavaScript code when meta data has been loaded (the information about the source).
onloadstart Execute JavaScript code when the source begins to load.
onmessage Execute JavaScript code when the document receives a message.
onmousedown Execute JavaScript code when the user holds down the mouse button on the element.
onmousemove Execute JavaScript code when the user moves the mouse on the element.
onmouseout Execute JavaScript code when the user moves the mouse out of the element.
onmouseover Execute JavaScript code when the user moves the mouse over the element.
onmouseup Execute JavaScript code when the user releases the mouse button on the element.
onoffline Execute JavaScript code when the network is offline.
ononline Execute JavaScript code when the network is online.
onpagehide Execute JavaScript code when the user navigates away from the document.
onpageshow Execute JavaScript code when the user navigates to the document.
onpaste Execute JavaScript code when the user pastes content in an element.
onpause Execute JavaScript code when the source has been paused.
onplay Execute JavaScript code when the source is ready to start playing.
onplaying Execute JavaScript code when the source is playing.
onpopstate Execute JavaScript code when the user navigates the session history.
onprogress Execute JavaScript code when the source is downloading.
onratechange Execute JavaScript code when the playback rate changes (slow, fast forward, etc).
onredo Execute JavaScript code when the user needs to redo.
onreset Execute JavaScript code when a button with the type attribute set to "reset" is clicked.
onresize Execute JavaScript code when the user resizes the document.
onscroll Execute JavaScript code when the user is scrolling the elements scrollbar.
onsearch Execute JavaScript code when the user presses the enter key or clicks the X in an input field with the type attribute set to "search".
onseeked Execute JavaScript code when the source has seeked.
onseeking Execute JavaScript code when the source is seeking.
onselect Execute JavaScript code when the user selects the text in an input field.
onstalled Execute JavaScript code if the source has been stalled (has failed to download).
onstorage Execute JavaScript code when the storage has been changed.
onsubmit Execute JavaScript code when the user submits the form.
onsuspend Execute JavaScript code if the source has been suspended.
ontimeupdate Execute JavaScript code when the current time of the source has changed.
ontoggle Execute JavaScript code when the user opens or closes the <details> element.
ontouchcancel Execute JavaScript code when the user stops touching the element.
ontouchmove Execute JavaScript code when the user is touching the element.
ontouchstart Execute JavaScript code when the user touches the element.
ontransitioncancel Execute JavaScript code when the elements transition (CSS) unexpectedly aborts.
ontransitionend Execute JavaScript code when the elements transition (CSS) ends.
onundo Execute JavaScript code when the user needs to undo.
onunload Execute JavaScript code when the document has been unloaded.
onvolumechange Execute JavaScript code when the volume has changed.
onwaiting Execute JavaScript code when the source is waiting for the user.
onwheel Execute JavaScript code when the user rolls the mouse button on the element.