HTML5 Tag Reference PDF
HTML5 Tag Reference PDF
Tags Tutorial
Created By www.ebooktutorials.blogspot.in
Next Reference
HTML5
HTML5 improves interoperability and reduces development costs by making precise rules on how to handle all HTML elements, and how to recover from
errors.
Some of the new features in HTML5 are functions for embedding audio, video, graphics, client-side data storage, and interactive documents. HTML5 also
contains new elements like <nav>, <header>, <footer>, and <figure>.
The HTML5 working group includes AOL, Apple, Google, IBM, Microsoft, Mozilla, Nokia, Opera, and many hundreds of other vendors.
Note: HTML5 is not a W3C recommendation yet!
To read about the HTML5 activities at W3C, please read our W3C tutorial.
Ordered Alphabetically
New : New tags in HTML5.
Tag
Description
<!--...-->
Defines a comment
<!DOCTYPE>
<a>
Defines a hyperlink
<abbr>
Defines an abbreviation
<acronym>
<address>
<applet>
<area>
<article>
<aside>
<audio>
<b>
<base>
<basefont>
<bdi>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<canvas>
New Used to draw graphics, on the fly, via scripting (usually JavaScript)
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<command>
<datalist>
<dd>
<del>
<details>
<dfn>
<dir>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
Created By www.ebooktutorials.blogspot.in
<figcaption>
<figure>
<font>
<footer>
<form>
<frame>
<frameset>
<h1> to <h6>
<head>
<header>
<hgroup>
<hr>
<html>
<i>
<iframe>
<img>
Defines an image
<input>
<ins>
<keygen>
<kbd>
<label>
<legend>
<li>
<link>
Defines the relationship between a document and an external resource (most used to link to style sheets)
<map>
<mark>
<menu>
<meta>
<meter>
<nav>
<noframes>
<noscript>
Defines an alternate content for users that do not support client-side scripts
<object>
<ol>
<optgroup>
<option>
<output>
<p>
Defines a paragraph
<param>
<pre>
<progress>
<q>
<rp>
New Defines what to show in browsers that do not support ruby annotations
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
New Defines multiple media resources for media elements (<video> and <audio>)
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<table>
Defines a table
<tbody>
<td>
Created By www.ebooktutorials.blogspot.in
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
New Defines text tracks for media elements (<video> and <audio>)
<tt>
<u>
<ul>
<var>
Defines a variable
<video>
<wbr>
Previous
Next Reference
Created By www.ebooktutorials.blogspot.in
Browser Support
<script type="text/javascript">
<!-function displayMsg()
{
alert("Hello World!")
}
//-->
</script>
Note: The two forward slashes at the end of comment line (//) is the JavaScript comment symbol. This prevents JavaScript from executing the --> tag.
Global Attributes
The comment element does not support any global attributes.
More information about Global Attributes.
Event Attributes
The comment element does not support any event attributes.
More information about Event Attributes.
Created By www.ebooktutorials.blogspot.in
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
Try it yourself
Browser Support
<!DOCTYPE html>
Created By www.ebooktutorials.blogspot.in
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
Try it yourself
Browser Support
W3SCHOOLS EXAMS
The <a> tag defines a hyperlink, which is used to link from one page to another.
The most important attribute of the <a> element is the href attribute, which indicates the links destination.
By default, links will appear as follows in all browsers:
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
Attributes
: New in HTML5.
New
Attribute
Value
Description
charset
char_encoding
coords
coordinates
href
URL
hreflang
language_code
media
New media_query
name
section_name
rel
alternate
author
bookmark
help
license
next
nofollow
noreferrer
prefetch
prev
search
tag
rev
text
shape
default
rect
circle
poly
target
_blank
_parent
_self
_top
framename
type
New MIME_type
Global Attributes
The <a> tag also supports the Global Attributes in HTML5.
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE
Share with
Created By www.ebooktutorials.blogspot.in
Event Attributes
The <a> tag also supports the Event Attributes in HTML5.
REPORT
ERROR
HOME
TOP
FORUM
ABOUT
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <abbr> tag also supports the Global Attributes in HTML5.
Event Attributes
The <abbr> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<address>
Written by <a href="mailto:webmaster@example.com">Jon Doe</a>.<br />
Visit us at:<br />
Example.com<br />
Box 564, Disneyland<br />
USA
</address>
Try it yourself
Browser Support
Global Attributes
The <address> tag also supports the Global Attributes in HTML5.
Event Attributes
The <address> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
alt
text
coords
coordinates
href
URL
media
nohref
rel
shape
default
rect
circle
poly
target
_blank
_parent
_self
_top
framename
type
New MIME_type
Created By www.ebooktutorials.blogspot.in
Global Attributes
The <area> tag also supports the Global Attributes in HTML5.
Event Attributes
The <area> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
The <article> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <article> tag.
Global Attributes
The <article> tag also supports the Global Attributes in HTML5.
Event Attributes
The <article> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
The <aside> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <aside> tag.
Global Attributes
The <aside> tag also supports the Global Attributes in HTML5.
Event Attributes
The <aside> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<audio controls="controls">
<source src="song.ogg" type="audio/ogg" />
<source src="song.mp3" type="audio/mp3" />
Your browser does not support the audio tag.
</audio>
Try it yourself
Browser Support
The <audio> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <audio> tag.
Attributes
New : New in HTML5.
Attribute
Value
Description
autoplay
New autoplay
controls
New controls
Specifies that audio controls should be displayed (such as a play/pause button etc).
loop
New loop
Specifies that the audio will start over again, every time it is finished
preload
New auto
metadata
none
Specifies if and how the author thinks the audio should be loaded when the page
loads
src
New URL
Global Attributes
The <audio> tag also supports the Global Attributes in HTML5.
Event Attributes
The <audio> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <b> tag also supports the Global Attributes in HTML5.
Event Attributes
The <b> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<head>
<base href="http://www.w3schools.com/images/" target="_blank" />
</head>
<body>
<img src="stickman.gif" alt="Stickman" width="24" height="39" />
<a href="http://www.w3schools.com">W3Schools</a>
</body>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
href
URL
Specifies the base URL for all relative URLs in the page
target
_blank
_parent
_self
_top
framename
Specifies the default target for all hyperlinks and forms in the page
Event Attributes
NONE
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<ul>
<li>User <bdi>hrefs</bdi>: 60 points</li>
<li>User <bdi>jdoe</bdi>: 80 points</li>
<li>User <bdi>????</bdi>: 90 points</li>
</ul>
Try it yourself
Browser Support
Global Attributes
The <bdi> tag also supports the Global Attributes in HTML5.
Event Attributes
The <bdi> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<bdo dir="rtl">
This text will go right-to-left.
</bdo>
Try it yourself
Browser Support
Attributes
Attribute
Value Description
dir
ltr
rtl
Required. Specifies the text direction of the text inside the <bdo> element
Global Attributes
The <bdo> tag also supports the Global Attributes in HTML5.
Event Attributes
The <bdo> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<blockquote cite="http://www.worldwildlife.org/who/index.html">
For 50 years, WWF has been protecting the future of nature. The worlds
leading conservation organization, WWF works in 100 countries and is
supported by 1.2 million members in the United States and close to 5 million
globally. WWF's unique way of working combines global reach with a
foundation in science, involves action at every level from local to global,
and ensures the delivery of innovative solutions that meet the needs of both
people and nature.
</blockquote>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
cite
URL
Global Attributes
The <blockquote> tag also supports the Global Attributes in HTML5.
Event Attributes
The <blockquote> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
Try it yourself
Browser Support
Global Attributes
The <body> tag also supports the Global Attributes in HTML5.
Event Attributes
The <body> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <br> tag also supports the Global Attributes in HTML5.
Event Attributes
The <br> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
New : New in HTML5.
Attribute
autofocus
disabled
Value
New autofocus
disabled
Description
Specifies that a button should
automatically get focus when the
page loads
Specifies that a button should be
disabled
form
New form_id
formaction
New URL
formenctype
New application/x-www-form-urlencoded
multipart/form-data
text/plain
formmethod
New get
post
formnovalidate
New formnovalidate
formtarget
New _blank
_self
_parent
_top
framename
name
name
type
button
reset
submit
Created By www.ebooktutorials.blogspot.in
value
text
Global Attributes
The <button> tag also supports the Global Attributes in HTML5.
Event Attributes
The <button> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A button with autofocus:
Browser Support
The autofocus attribute is supported in all major browsers, except Internet Explorer and Opera.
Syntax
<button type="button" autofocus="autofocus">
Note: The autofocus attribute is a boolean attribute, and can be set in the following ways:
<button autofocus>
<button autofocus="autofocus">
<button autofocus="">
HTML5 <button> tag
Created By www.ebooktutorials.blogspot.in
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Example
A disabled button:
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
Try it yourself
Browser Support
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Build a FREE Website
W3SCHOOLS EXAMS
Syntax
<button disabled="disabled">
Note: The disabled attribute is a boolean attribute, and can be set in the following ways:
<button disabled>
<button disabled="disabled">
<button disabled="">
HTML5 <button> tag
Share with
Created By www.ebooktutorials.blogspot.in
Example
A button located outside a form (but still a part of the form):
Browser Support
The form attribute is supported in all major browsers, except Internet Explorer.
Syntax
<button form="form_id">
Attribute Values
Value
Description
form_id
Specifies a space-separated list of id's to one or more forms the button belongs to
Created By www.ebooktutorials.blogspot.in
Example
A form with two submit buttons. The first submit button submits the form data to "demo_form.asp",
and the second submits to "demo_admin.asp":
Browser Support
The formaction attribute is supported in all major browsers, except Internet Explorer.
Syntax
<button type="submit" formaction="URL">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
A form with two submit buttons. The first submit button submits the form data with default
character encoding, and the second submits the form data without character encoding:
Browser Support
Syntax
<button type="submit" formenctype="value">
Attribute Values
Value
Description
application/x-www-form-urlencoded
multipart/form-data
No characters are encoded (use this when you are using forms
that have a file upload control)
text/plain
Created By www.ebooktutorials.blogspot.in
Example
A form with two submit buttons.The first submit button submits the form data with method="get",
and the second submits the form data with method="post":
Browser Support
The formmethod attribute is supported in all major browsers, except Internet Explorer.
Syntax
<button type="submit" formmethod="get|post">
Attribute Values
Value
Description
get
post
Created By www.ebooktutorials.blogspot.in
Example
A form with two submit buttons. The first submit button submits the form data with default
validation, and the second submits the form data without validation:
Browser Support
The formnovalidate attribute is supported in all major browsers, except Internet Explorer and Safari.
Syntax
<button type="submit" formnovalidate="formnovalidate">
Note: The formnovalidate attribute is a boolean attribute, and can be set in the following ways:
<button formnovalidate>
<button formnovalidate="formnovalidate">
<button formnovalidate="">
HTML5 <button> tag
Created By www.ebooktutorials.blogspot.in
Example
A form with two submit buttons. The first submit button submits the form data with default target
("_self"), and the second submits the form data to a new window (target="_blank"):
Browser Support
The formtarget attribute is supported in all major browsers, except Internet Explorer.
Syntax
<button type="submit" formtarget="_blank|_self|_parent|_top|framename">
Attribute Values
Value
Description
_blank
_self
_parent
_top
framename
Created By www.ebooktutorials.blogspot.in
Example
Two buttons with equal names, that submit different values when clicked:
Browser Support
Syntax
<button name="name">
Attribute Values
Value
Description
name
Created By www.ebooktutorials.blogspot.in
Example
A form with two buttons. One submit button and one reset button:
Browser Support
Syntax
<button type="button|submit|reset">
Attribute Values
Value
Description
button
submit
reset
Created By www.ebooktutorials.blogspot.in
Example
Two buttons with equal names, that submit different values when clicked:
Browser Support
Syntax
<button value="value">
Attribute Values
Value
Description
value
Created By www.ebooktutorials.blogspot.in
<canvas id="myCanvas"></canvas>
<script type="text/javascript">
var canvas=document.getElementById('myCanvas');
var ctx=canvas.getContext('2d');
ctx.fillStyle='#FF0000';
ctx.fillRect(0,0,80,100);
</script>
Try it yourself
Browser Support
The <canvas> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <canvas> tag.
Attributes
New : New in HTML5.
Attribute
Value
Description
height
New pixels
width
New pixels
Global Attributes
The <canvas> tag also supports the Global Attributes in HTML5.
Event Attributes
The <canvas> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A <canvas> element with a height and width of 200 pixels:
Browser Support
Syntax
<canvas height="pixels">
Attribute Values
Value
Description
pixels
Specifies the height of the canvas, in pixels (e.g. "100"). Default height is "150"
Created By www.ebooktutorials.blogspot.in
Example
A <canvas> element with a height and width of 200 pixels:
Browser Support
Syntax
<canvas width="pixels">
Attribute Values
Value
Description
pixels
Specifies the width of the canvas, in pixels (e.g. "100"). Default width is "300"
Created By www.ebooktutorials.blogspot.in
<table border="1">
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it yourself
Browser Support
Global Attributes
The <caption> tag also supports the Global Attributes in HTML5.
Event Attributes
The <caption> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <cite> tag also supports the Global Attributes in HTML5.
Event Attributes
The <cite> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<em>Emphasized text</em>
<strong>Strong text</strong>
<dfn>Definition term</dfn>
<code>Computer code</code>
<samp>Sample output from computer program</samp>
<kbd>Keyboard input</kbd>
<var>Variable</var>
Try it yourself
Browser Support
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags are supported in all major browsers.
Description
<em>
<strong>
<dfn>
<code>
<samp>
<kbd>
<var>
Defines a variable
Global Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Global Attributes in HTML5.
Event Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<table border="1">
<colgroup>
<col span="2" style="background-color:red" />
<col style="background-color:yellow" />
</colgroup>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
align
left
right
center
justify
char
char
character
charoff
number
span
number
valign
top
middle
bottom
baseline
width
%
pixels
relative_length
Global Attributes
The <col> tag also supports the Global Attributes in HTML5.
Event Attributes
The <col> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<table>
<colgroup>
<col span="2" style="background-color:red" />
<col style="background-color:yellow" />
</colgroup>
<tr>
<th>ISBN</th>
<th>Title</th>
<th>Price</th>
</tr>
<tr>
<td>3476896</td>
<td>My first HTML</td>
<td>$53</td>
</tr>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
align
left
right
center
justify
char
char
character
charoff
number
span
number
valign
top
middle
bottom
baseline
width
%
pixels
relative_length
Global Attributes
The <colgroup> tag also supports the Global Attributes in HTML5.
Event Attributes
The <colgroup> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<menu>
<command type="command" label="Save" onclick="save()">Save</command>
</menu>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
checked
New checked
Specifies that the command should be checked when the page loads. Only for
type="radio" or type="checkbox"
disabled
New disabled
icon
New URL
label
New text
radiogroup
New groupname
Specifies the name of the group of commands that will be toggled when the command
itself is toggled. Only for type="radio"
type
New checkbox
command
radio
Global Attributes
The <command> tag also supports the Global Attributes in HTML5.
Event Attributes
The <command> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <datalist> tag also supports the Global Attributes in HTML5.
Event Attributes
The <datalist> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
Try it yourself
Browser Support
Global Attributes
The <dd> tag also supports the Global Attributes in HTML5.
Event Attributes
The <dd> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
Attribute
Value
Description
cite
URL
datetime
YYYY-MM-DDThh:mm:ssTZD
Global Attributes
The <del> tag also supports the Global Attributes in HTML5.
Event Attributes
The <del> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<details>
<summary>Copyright 1999-2011.</summary>
<p> - by Refsnes Data. All Rights Reserved.</p>
<p>All content and graphics on this web site are the property of the company
Refsnes Data.</p>
</details>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
New open
open
Description
Specifies that the details should be visible (open) to the user
Global Attributes
The <details> tag also supports the Global Attributes in HTML5.
Event Attributes
The <details> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<div style="color:#00FF00">
<h3>This is a heading</h3>
<p>This is a paragraph.</p>
</div>
Try it yourself
Browser Support
Global Attributes
The <div> tag also supports the Global Attributes in HTML5.
Event Attributes
The <div> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
Try it yourself
Browser Support
Global Attributes
The <dl> tag also supports the Global Attributes in HTML5.
Event Attributes
The <dl> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
Try it yourself
Browser Support
Global Attributes
The <dt> tag also supports the Global Attributes in HTML5.
Event Attributes
The <dt> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
height
New pixels
src
New URL
type
New MIME_type
width
New pixels
Global Attributes
The <embed> tag also supports the Global Attributes in HTML5.
Event Attributes
The <embed> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text" /><br />
Email: <input type="text" /><br />
Date of birth: <input type="text" />
</fieldset>
</form>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
disabled
New disabled
form
New form_id
name
New text
Global Attributes
The <fieldset> tag also supports the Global Attributes in HTML5.
Event Attributes
The <fieldset> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<figure>
<img src="img_pulpit.jpg" alt="The Pulpit Rock"
width="304" height="228" />
<figcaption>Fig1. - A view of the pulpit rock in Norway.</figcaption>
</figure>
Try it yourself
Browser Support
The <figcaption> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <figcaption> tag.
Global Attributes
The <figcaption> tag also supports the Global Attributes in HTML5.
Event Attributes
The <figcaption> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<figure>
<img src="img_pulpit.jpg" alt="The Pulpit Rock"
width="304" height="228" />
</figure>
Try it yourself
Browser Support
The <figure> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <figure> tag.
Global Attributes
The <figure> tag also supports the Global Attributes in HTML5.
Event Attributes
The <figure> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<footer>
<p>Posted by: Hege Refsnes</p>
<p><time pubdate datetime="2012-03-01"></time></p>
</footer>
Try it yourself
Browser Support
The <footer> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <footer> tag.
Global Attributes
The <footer> tag also supports the Global Attributes in HTML5.
Event Attributes
The <footer> tag also supports the Event Attributes
s in HTML5.
Created By www.ebooktutorials.blogspot.in
<form action="demo_form.asp">
First name: <input type="text" name="fname" value="Mickey" /><br />
Last name:<input type="text" name="lname" value="Mouse" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
accept
MIME_type
accept-charset
character_set
action
URL
autocomplete
New on
off
enctype
application/x-www-form-urlencoded
multipart/form-data
text/plain
method
get
post
text
name
novalidate
New novalidate
_blank
_self
_parent
_top
target
Global Attributes
The <form> tag also supports the Global Attributes in HTML5.
Event Attributes
The <form> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<h1>This
<h2>This
<h3>This
<h4>This
<h5>This
<h6>This
is
is
is
is
is
is
heading
heading
heading
heading
heading
heading
1</h1>
2</h2>
3</h3>
4</h4>
5</h5>
6</h6>
Try it yourself
Browser Support
Global Attributes
The <h1> to <h6> tags also supports the Global Attributes in HTML5.
Event Attributes
The <h1> to <h6> tags also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
Try it yourself
Browser Support
Global Attributes
The <head> tag also supports the Global Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<article>
<header>
<h1>Internet Explorer 9</h1>
<p><time pubdate datetime="2011-03-15"></time></p>
</header>
<p>Windows Internet Explorer 9 (abbreviated as IE9) was released to
the public on March 14, 2011 at 21:00 PDT.....</p>
</article>
Try it yourself
Browser Support
The <header> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <header> tag.
Global Attributes
The <header> tag also supports the Global Attributes in HTML5.
Event Attributes
The <header> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<hgroup>
<h1>Welcome to my WWF</h1>
<h2>For a living planet</h2>
</hgroup>
<p>The rest of the content...</p>
Try it yourself
Browser Support
The <hgroup> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <hgroup> tag.
Global Attributes
The <hgroup> tag also supports the Global Attributes in HTML5.
Event Attributes
The <hgroup> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<h1>HTML</h1>
<p>HTML is a language for describing web pages.....</p>
<hr />
<h1>CSS</h1>
<p>CSS defines how to display HTML elements.....</p>
Try it yourself
Browser Support
Global Attributes
The <hr> tag also supports the Global Attributes in HTML5.
Event Attributes
The <hr> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<!DOCTYPE HTML>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
manifest
xmlns
Value
New URL
Description
Specifies the address of the document's cache
manifest (for offline browsing)
Global Attributes
The <html> tag also supports the Global Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A HTML document with a cache manifest (for offline browsing):
<!DOCTYPE HTML>
<html manifest="demo.appcache">
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
Try it yourself
Browser Support
The manifest attribute is supported in all major browsers, except Internet Explorer.
Syntax
<html manifest="URL">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <i> tag also supports the Global Attributes in HTML5.
Event Attributes
The <i> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<iframe src="http://www.w3schools.com"></iframe>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
frameborder
1
0
height
pixels
longdesc
URL
marginheight
pixels
marginwidth
pixels
name
name
New ""
allow-forms
allow-same-origin
allow-scripts
allow-top-navigation
sandbox
scrolling
yes
no
auto
New seamless
seamless
src
Specifies that the iframe should look like it is a part of the containing document
URL
srcdoc
New HTML_code
width
pixels
Global Attributes
The <iframe> tag also supports the Global Attributes in HTML5.
Event Attributes
The <iframe> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
An inline frame with a specified height and width of 200 pixels:
Browser Support
Syntax
<iframe height="pixels">
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
Example
An <iframe> that act as a target for a link:
Browser Support
Syntax
<iframe name="name">
Attribute Values
Value
Description
name
Created By www.ebooktutorials.blogspot.in
Example
An iframe with extra restrictions:
Browser Support
Syntax
<iframe sandbox="value">
Attribute Values
Value
Description
""
allow-same-origin
Allows the iframe content to be treated as being from the same origin as the
containing document
allow-top-navigation
Allows the iframe content to navigate (load) content from the containing
document
allow-forms
allow-scripts
Created By www.ebooktutorials.blogspot.in
Example
An <iframe> that looks like it is a part of the containing document:
Browser Support
Syntax
<iframe seamless="seamless">
Note: The seamless attribute is a boolean attribute, and can be set in the following ways:
<iframe seamless>
<iframe seamless="seamless">
<iframe seamless="">
HTML5 <iframe> tag
Created By www.ebooktutorials.blogspot.in
Example
An inline frame in its simplest use:
<iframe src="html5_reference.asp"></iframe>
Try it yourself
Browser Support
Syntax
<iframe src="URL">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
An <iframe> with a srcdoc attribute:
Browser Support
The srcdoc attribute is currently not supported in any of the major browsers.
Syntax
<iframe srcdoc="HTML_code">
Attribute Values
Value
Description
HTML_code
The HTML content to show in the iframe. Must be valid HTML syntax
Created By www.ebooktutorials.blogspot.in
Example
An inline frame with a specified height and width of 200 pixels:
Browser Support
Syntax
<iframe width="pixels">
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
Attribute
Value
Description
src
URL
alt
text
height
pixels
ismap
ismap
usemap
#mapname
width
pixels
Global Attributes
The <img> tag also supports the Global Attributes in HTML5.
Event Attributes
The <img> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
An image:
Browser Support
Syntax
<img src="URL" />
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
An image with an alternate text specified:
Browser Support
Syntax
<img alt="text" />
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
Specify the height and width of an image:
Browser Support
Syntax
<img height="pixels" />
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
Example
A server-side image-map:
<a href="demo_form.asp">
<img src="img_logo.gif" ismap="ismap" alt="W3Schools.com" />
</a>
Try it yourself
Browser Support
Syntax
<img ismap="ismap" />
Note: The ismap attribute is a boolean attribute, and can be set in the following ways:
<img ismap>
<img ismap="ismap">
<img ismap="">
HTML5 <img> tag
Created By www.ebooktutorials.blogspot.in
Example
An image-map, with clickable areas:
Browser Support
Syntax
<img usemap="#mapname" />
Attribute Values
Value
Description
#mapname
A hash character ("#") plus the name or id of the <map> element to use
Created By www.ebooktutorials.blogspot.in
Example
Specify the height and width of an image:
Browser Support
Syntax
<img width="pixels" />
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
accept
audio/*
video/*
image/*
MIME_type
alt
text
autocomplete
New on
off
autofocus
New autofocus
checked
checked
disabled
disabled
form
New form_id
formaction
New URL
formenctype
New application/x-www-form-urlencoded
multipart/form-data
text/plain
formmethod
New get
post
Created By www.ebooktutorials.blogspot.in
formnovalidate New formnovalidate
formtarget
New _blank
_self
_parent
_top
framename
height
New pixels
list
New datalist_id
max
New number
date
maxlength
number
min
New number
date
multiple
New multiple
name
text
pattern
New regexp
placeholder
New text
readonly
readonly
required
New required
size
number
src
URL
step
New number
type
button
checkbox
color
date
datetime
datetime-local
email
file
hidden
image
month
number
password
radio
range
reset
search
submit
tel
text
time
url
week
value
text
width
New pixels
Global Attributes
The <input> tag also supports the Global Attributes in HTML5.
Event Attributes
The <input> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
Specify that the server accepts only image files in the file upload:
<form action="demo_form.asp">
<input type="file" name="pic" accept="image/*" />
<input type="submit" />
</form>
Try it yourself
Browser Support
The accept attribute is supported in all major browsers, except Internet Explorer and Safari.
Syntax
<input accept="audio/*|video/*|image/*|MIME_type" />
Tip: To specify more than one value, separate the values with a comma (e.g. <input accept="audio/*,video/*,image/*" />.
Attribute Values
Value
Description
audio/*
video/*
image/*
MIME_type
A valid MIME type, with no parameters. Look at IANA MIME types for a complete list of standard MIME types
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with two different input types; text and submit:
<form action="demo_form.asp">
Username: <input type="text" name="usrname" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
The type attribute works in all major browsers. However, not all the different input types works in all
major browsers.
Look below to see browser-support for each input type.
Syntax
<input type="value" />
Attribute Values
Value
Description
button
checkbox
Defines a checkbox
color
date
New Defines a date control (year, month and day (no time))
datetime
New Defines a date and time control (year, month, day, hour, minute, second, and
fraction of a second, based on UTC time zone)
datetime-local
New Defines a date and time control (year, month, day, hour, minute, second, and
fraction of a second (no time zone)
file
hidden
image
month
number
password
radio
range
reset
search
submit
tel
text
time
New Defines a control for entering a number whose exact value is not important
(like a slider control)
Defines a reset button (resets all form values to default values)
New Defines a text field for entering a search string
Defines a submit button
New Defines a field for entering a telephone number
Default. Defines a single-line text field (default width is 20 characters)
New Defines a control for entering a time (no time zone)
Created By www.ebooktutorials.blogspot.in
url
week
Examples
Input type: button
Example
A clickable button, that activates a JavaScript when it is clicked:
Created By www.ebooktutorials.blogspot.in
Input type: email
Example
Define a field for an e-mail address (will be automatically validated when submitted):
Tip: Safari on iPhone recognizes the email type, and changes the on-screen keyboard to match it (adds
@ and .com options).
Created By www.ebooktutorials.blogspot.in
Input type: password
Example
Define a password field (characters are masked)
Tip: Use the reset button carefully! It can be annoying for users who accidentally activate the reset
button.
Created By www.ebooktutorials.blogspot.in
Try it yourself
Tip: Safari on iPhone recognizes the url input type, and changes the on-screen keyboard to match it
(adds .com option).
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with initial (default) values:
<form action="demo_form.asp">
First name: <input type="text" name="fname" value="Peter" /><br />
Last name: <input type="text" name="lname" value="Griffin" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<input value="text" />
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
Define an image as the submit button, with height and width attributes:
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="image" src="img_submit.gif" alt="Submit" width="48"
height="48"/>
</form>
Try it yourself
Browser Support
Syntax
<input width="pixels" />
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Example
An HTML form with an input field with a specified legal number intervals:
<form action="demo_form.asp">
<input type="number" name="points" step="3" />
<input type="submit" />
</form>
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
Try it yourself
Browser Support
Syntax
<input step="number" />
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with an image that represents the submit button:
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="image" src="img_submit.gif" alt="Submit" width="48" height="48"
/>
</form>
Try it yourself
Browser Support
Syntax
<input alt="text" />
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with autocomplete on (and off for one input field):
Browser Support
Syntax
<input autocomplete="on|off" />
Attribute Values
Value
Description
on
off
Created By www.ebooktutorials.blogspot.in
Example
Let the "First name" input field automatically get focus when the page loads:
<form action="demo_form.asp">
First name:<input type="text" name="fname" autofocus="autofocus" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" />
</form>
Try it yourself
Browser Support
The autofocus attribute is supported in all major browsers, except Internet Explorer.
Syntax
<input autofocus="autofocus" />
Note: The autofocus attribute is a boolean attribute, and can be set in the following ways:
<input autofocus>
<input autofocus="autofocus">
<input autofocus="">
HTML5 <input> tag
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with a pre-selected checkbox:
<form action="demo_form.asp">
<input type="checkbox" name="vehicle" value="Bike" /> I have a bike<br />
<input type="checkbox" name="vehicle" value="Car" checked="checked" /> I have
a car <br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<input checked="checked" />
Note: The checked attribute is a boolean attribute, and can be set in the following ways:
<input checked>
<input checked="checked">
<input checked="">
HTML5 <input> tag
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with one disabled input field:
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" disabled="disabled" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<input disabled="disabled" />
Note: The disabled attribute is a boolean attribute, and can be set in the following ways:
<input disabled>
<input disabled="disabled">
<input disabled="">
HTML5 <input> tag
Created By www.ebooktutorials.blogspot.in
Example
An input field located outside the HTML form (but still a part of the form):
Browser Support
The form attribute is supported in all major browsers, except Internet Explorer.
Syntax
<input form="form_id" />
Attribute Values
Value
Description
form_id
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with two submit buttons, with different actions:
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit" /><br />
<input type="submit" formaction="demo_admin.asp" value="Submit as admin" />
</form>
Try it yourself
Browser Support
The formaction attribute is supported in all major browsers, except Internet Explorer.
Syntax
<input formaction="URL" />
Attribute Values
Value
Description
URL
Specifies the URL of the file that will process the input control when the form is
submitted.
Possible values:
An absolute URL - the full address of a page (like
href="http://www.example.com/formresult.asp")
A relative URL - points to a file within the current site (like
href="formresult.asp")
Created By www.ebooktutorials.blogspot.in
Example
Send form-data that is default encoded (the first submit button), and encoded as "multipart/formdata" (the second submit button):
Browser Support
The formenctype attribute is supported in all major browsers, except Internet Explorer.
Syntax
<input formenctype="value" />
Attribute Values
Value
Description
application/x-www-form-urlencoded
multipart/form-data
text/plain
Created By www.ebooktutorials.blogspot.in
Example
The second submit button overrides the HTTP method of the form:
Browser Support
The formmethod attribute is supported in all major browsers, except Internet Explorer.
Syntax
<input formmethod="get|post" />
Attribute Values
Value
Description
get
post
Created By www.ebooktutorials.blogspot.in
Example
A form with two submit buttons (with and without validation):
<form action="demo_form.asp">
E-mail: <input type="email" name="userid" /><br />
<input type="submit" value="Submit" /><br />
<input type="submit" formnovalidate="formnovalidate" value="Submit without
validation" />
</form>
Try it yourself
Browser Support
The formnovalidate attribute works in all major browsers, except Internet Explorer and Safari.
Syntax
<input formnovalidate="formnovalidate" />
Note: The formnovalidate attribute is a boolean attribute, and can be set in the following ways:
<input formnovalidate>
<input formnovalidate="formnovalidate">
<input formnovalidate="">
HTML5 <input> tag
Created By www.ebooktutorials.blogspot.in
Example
A form with two submit buttons, with different target windows:
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit as normal" />
<input type="submit" formtarget="_blank" value="Submit to a new window" />
</form>
Try it yourself
Browser Support
The formtarget attribute is supported in all major browsers, except Internet Explorer.
Syntax
<input formtarget="_blank|_self|_parent|_top|framename" />
Attribute Values
Value
Description
_blank
_self
_parent
_top
framename
Created By www.ebooktutorials.blogspot.in
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Example
Define an image as the submit button, with height and width attributes:
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="image" src="img_submit.gif" alt="Submit" width="48"
height="48"/>
</form>
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Try it yourself
Browser Support
Syntax
<input height="pixels" />
Attribute Values
Value
Description
pixels
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript,
XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE
Share with
Created By www.ebooktutorials.blogspot.in
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Example
An <input> element with pre-defined values in a <datalist>:
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Build a FREE Website
Try it yourself
W3SCHOOLS EXAMS
Browser Support
Syntax
<input list="datalist_id" />
Attribute Values
Value
Description
datalist_id
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE
Share with
Created By www.ebooktutorials.blogspot.in
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Example
Use of the min and max attributes:
<form action="demo_form.asp">
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31">
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-02">
Quantity (between 1 and 5):
<input type="number" name="quantity" min="1" max="5" />
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Build a FREE Website
W3SCHOOLS EXAMS
</form>
Try it yourself
W3SCHOOLS BOOKS
Browser Support
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Syntax
<input max="number|date" />
Attribute Values
Value
Description
number
date
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE
Share with
Created By www.ebooktutorials.blogspot.in
Example
An <input> element with a maximum length of 10 characters:
<form action="demo_form.asp">
Username: <input type="text" name="usrname" maxlength="10" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<input maxlength="number" />
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Example
Use of the min and max attributes:
<form action="demo_form.asp">
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31">
Enter a date after 2000-01-01:
<input type="date" name="bday" min="2000-01-02">
Quantity (between 1 and 5):
<input type="number" name="quantity" min="1" max="5" />
<input type="submit" />
</form>
Try it yourself
Browser Support
Syntax
<input min="number|date" />
Attribute Values
Value
Description
number
date
Created By www.ebooktutorials.blogspot.in
Example
A file upload field that accepts multiple values:
<form action="demo_form.asp">
Select images: <input type="file" name="img" multiple="multiple" />
<input type="submit" />
</form>
Try it yourself
Browser Support
The multiple attribute works in all major browsers, except Internet Explorer.
Syntax
<input multiple="multiple" />
Note: The multiple attribute is a boolean attribute, and can be set in the following ways:
<input multiple>
<input multiple="multiple">
<input multiple="">
HTML5 <input> tag
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with three input fields; two text fields and one submit button:
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<input name="text" />
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with an input field that can contain only three letters (no numbers or special
characters):
<form action="demo_form.asp">
Country code: <input type="text" name="country_code" pattern="[A-Za-z]{3}"
title="Three letter country code" />
<input type="submit" />
</form>
Try it yourself
Browser Support
The pattern attribute works in all major browsers, except Internet Explorer and Safari.
Syntax
<input pattern="regexp" />
Attribute Values
Value
Description
regexp
Specifies a regular expression that the <input> element's value is checked against
Created By www.ebooktutorials.blogspot.in
Example
Two input fields with a placeholder text:
<form action="demo_form.asp">
<input type="text" name="fname" placeholder="First name" /><br />
<input type="text" name="lname" placeholder="Last name" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
The placeholder attribute is supported in all major browsers, except Internet Explorer.
Syntax
<input placeholder="text" />
Attribute Values
Value
Description
text
Specifies a short hint that describes the expected value of the input field
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with a read-only input field:
<form action="demo_form.asp">
Country: <input type="text" name="country" value="Norway" readonly="readonly"
/><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<input readonly="readonly" />
Note: The readonly attribute is a boolean attribute, and can be set in the following ways:
<input readonly>
<input readonly="readonly">
<input readonly="">
HTML5 <input> tag
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with a required input field:
<form action="demo_form.asp">
Username: <input type="text" name="usrname" required="required" />
<input type="submit" />
</form>
Try it yourself
Browser Support
The required attribute works in all major browsers, except Internet Explorer and Safari.
Syntax
<input required="required" />
Note: The required attribute is a boolean attribute, and can be set in the following ways:
<input required>
<input required="required">
<input required="">
HTML5 <input> tag
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with two input fields with a width of 30 and 8 characters:
<form action="demo_form.asp">
Username: <input type="text" name="email" size="30" /><br />
Password: <input type="password" name="pwd" size="8" /><br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<input size="number" />
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Example
An HTML form with an image that represents the submit button:
<form action="demo_form.asp">
First name: <input type="text" name="fname" /><br />
Last name: <input type="text" name="lname" /><br />
<input type="image" src="img_submit.gif" alt="Submit" width="48" height="48"
/>
</form>
Try it yourself
Browser Support
Syntax
<input src="URL" />
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
Attribute
Value
Description
cite
URL
datetime
YYYY-MM-DDThh:mm:ssTZD
Global Attributes
The <ins> tag also supports the Global Attributes in HTML5.
Event Attributes
The <ins> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
The <keygen> tag is supported in all major browsers, except Internet Explorer.
Note: Safari supports the <keygen> element on Mac only.
Attributes
New : New in HTML5.
Attribute
Value
Description
autofocus
New autofocus Specifies that a <keygen> element should automatically get focus
when the page loads
challenge
New challenge Specifies that the value of the <keygen> element should be
challenged when submitted
disabled
New disabled
form
New form_id
keytype
New rsa
dsa
ec
name
New name
Global Attributes
The <keygen> tag also supports the Global Attributes in HTML5.
Event Attributes
The <keygen> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<em>Emphasized text</em>
<strong>Strong text</strong>
<dfn>Definition term</dfn>
<code>Computer code</code>
<samp>Sample output from computer program</samp>
<kbd>Keyboard input</kbd>
<var>Variable</var>
Try it yourself
Browser Support
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags are supported in all major
browsers.
Description
<em>
<strong>
<dfn>
<code>
<samp>
<kbd>
<var>
Defines a variable
Global Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Global
Attributes in HTML5.
Event Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Event
Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<form>
<label for="male">Male</label>
<input type="radio" name="sex" id="male" />
<br />
<label for="female">Female</label>
<input type="radio" name="sex" id="female" />
</form>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
for
element_id
form
New form_id
Global Attributes
The <label> tag also supports the Global Attributes in HTML5.
Event Attributes
The <label> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
Two radio buttons with labels:
<form action="demo_form.asp">
<label for="male">Male</label>
<input type="radio" name="sex" id="male" value="male" />
<br />
<label for="female">Female</label>
<input type="radio" name="sex" id="female" value="female" />
<br />
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<label for="element_id">
Attribute Values
Value
Description
element_id
Created By www.ebooktutorials.blogspot.in
Example
A <label> element located outside a form (but still a part of the form):
Browser Support
Syntax
<label form="form_id">
Attribute Values
Value
Description
form_id
Specifies a space-separated list of id's to one or more forms the <label> element belongs to
Created By www.ebooktutorials.blogspot.in
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text" size="30" /><br />
Email: <input type="text" size="30" /><br />
Date of birth: <input type="text" size="10" />
</fieldset>
</form>
Try it yourself
Browser Support
Global Attributes
The <legend> tag also supports the Global Attributes in HTML5.
Event Attributes
The <legend> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
value
number
Specifies the value of a list item. The following list items will increment from that number
(only for <ol> lists)
Global Attributes
The <li> tag also supports the Global Attributes in HTML5.
Event Attributes
The <li> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
charset
char_encoding
href
URL
hreflang
language_code
media
media_query
rel
alternate
archives
author
bookmark
external
first
help
icon
last
licence
next
nofollow
noreferrer
pingback
prefetch
prev
search
sidebar
stylesheet
tag
up
reversed relationship
rev
sizes
New HeightxWidth
any
target
_blank
_self
_top
_parent
frame_name
type
MIME_type
Created By www.ebooktutorials.blogspot.in
Global Attributes
The <link> tag also supports the Global Attributes in HTML5.
Event Attributes
The <link> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
Link to an external stylesheet:
Browser Support
Syntax
<link href="URL" />
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
Here, the hreflang attribute indicates that the linked document is in English:
Browser Support
Syntax
<link hreflang="language_code" />
Attribute Values
Value
Description
language_code
A two-letter language code that specifies the language of the linked document.
To view all available language codes, go to our Language code reference.
Created By www.ebooktutorials.blogspot.in
Example
Two different style sheets for two different media types (screen and print):
<head>
<link rel="stylesheet" type="text/css" href="demo_media_screen.css"/>
<link rel="stylesheet" type="text/css" href="demo_media_print.css"
media="print" />
</head>
Try it yourself
Browser Support
Syntax
<link media="value" />
Possible Operators
Value
Description
and
not
Specifies an OR operator
Devices
Value
Description
all
aural
Speech synthesizers
braille
handheld
projection
Projectors
screen
Computer screens
tty
tv
Values
Value
Description
width
height
device-width
device-height
Created By www.ebooktutorials.blogspot.in
"min-" and "max-" prefixes can be used.
Example: media="screen and (device-height:500px)"
orientation
aspect-ratio
device-aspect-ratio
color
color-index
monochrome
resolution
scan
grid
Created By www.ebooktutorials.blogspot.in
Example
An external stylesheet:
Browser Support
Syntax
<link rel="value" />
Attribute Values
Value
Description
alternate
author
help
icon
license
next
Indicates that the document is a part of a series, and that the next document in
the series is the referenced document
prefetch
prev
Indicates that the document is a part of a series, and that the previous
document in the series is the referenced document
search
stylesheet
Created By www.ebooktutorials.blogspot.in
Example
Icon with specified size:
Browser Support
The sizes attribute is not currently supported in any of the major browsers.
Syntax
<link sizes="HeightxWidth|any" />
Attribute Values
Value
Description
HeightxWidth
any
Created By www.ebooktutorials.blogspot.in
Example
An external stylesheet:
Browser Support
Syntax
<link type="MIME_type" />
Attribute Values
Value
Description
MIME_type
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
Attribute
Value
Description
name
mapname
Global Attributes
The <map> tag also supports the Global Attributes in HTML5.
Event Attributes
The <map> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
An image-map, with clickable areas:
Browser Support
Syntax
<map name="mapname">
Attribute Values
Value
Description
mapname
Created By www.ebooktutorials.blogspot.in
Browser Support
The <mark> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <mark> tag.
Global Attributes
The <mark> tag also supports the Global Attributes in HTML5.
Event Attributes
The <mark> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<menu type="toolbar">
<li>
<menu label="File">
<button type="button"
<button type="button"
<button type="button"
</menu>
</li>
<li>
<menu label="Edit">
<button type="button"
<button type="button"
<button type="button"
</menu>
</li>
</menu>
onclick="file_new()">New...</button>
onclick="file_open()">Open...</button>
onclick="file_save()">Save</button>
onclick="edit_cut()">Cut</button>
onclick="edit_copy()">Copy</button>
onclick="edit_paste()">Paste</button>
Try it yourself
Browser Support
The <menu> tag is not currently supported in any of the major browsers.
Attributes
New : New in HTML5.
Attribute
Value
Description
label
New text
type
New context
toolbar
list
Global Attributes
The <menu> tag also supports the Global Attributes in HTML5.
Event Attributes
The <menu> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A toolbar with two menu buttons on it ("File" and "Edit"), each of which has a dropdown menu with
a series of options:
<menu type="toolbar">
<li>
<menu label="File">
<button type="button"
<button type="button"
<button type="button"
</menu>
</li>
<li>
<menu label="Edit">
<button type="button"
<button type="button"
<button type="button"
</menu>
</li>
</menu>
onclick="file_new()">New...</button>
onclick="file_open()">Open...</button>
onclick="file_save()">Save</button>
onclick="edit_cut()">Cut</button>
onclick="edit_copy()">Copy</button>
onclick="edit_paste()">Paste</button>
Try it yourself
Browser Support
The label attribute is not currently supported in any of the major browsers.
Syntax
<menu label="text">
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
A toolbar with two menu buttons on it ("File" and "Edit"), each of which has a dropdown menu with
a series of options:
<menu type="toolbar">
<li>
<menu label="File">
<button type="button"
<button type="button"
<button type="button"
</menu>
</li>
<li>
<menu label="Edit">
<button type="button"
<button type="button"
<button type="button"
</menu>
</li>
</menu>
onclick="file_new()">New...</button>
onclick="file_open()">Open...</button>
onclick="file_save()">Save</button>
onclick="edit_cut()">Cut</button>
onclick="edit_copy()">Copy</button>
onclick="edit_paste()">Paste</button>
Try it yourself
Browser Support
The type attribute is not currently supported in any of the major browsers.
Syntax
<menu type="list|context|toolbar">
Attribute Values
Value
Description
list
Default. Specifies a list menu. A list of commands (li elements), that the user can perform or activate
context
Specifies a context menu. The menu must be activated before the user can interact with the commands
toolbar
Specifies a toolbar menu. Active commands, allows the user to interact with the commands immediately
Created By www.ebooktutorials.blogspot.in
<head>
<meta name="description" content="Free Web tutorials" />
<meta name="keywords" content="HTML,CSS,XML,JavaScript" />
<meta name="author" content="Stle Refsnes" />
<meta charset="UTF-8" />
</head>
Try it yourself
Browser Support
Examples
Example 1 - Define keywords for search engines:
Attributes
New : New in HTML5.
Created By www.ebooktutorials.blogspot.in
Attribute
charset
Value
New character_set
Description
Specifies the character encoding for the HTML document
content
text
http-equiv
content-type
default-style
refresh
name
application-name
author
description
generator
keywords
scheme
format/URI
Global Attributes
The <meta> tag also supports the Global Attributes in HTML
Created By www.ebooktutorials.blogspot.in
Example
Specify the characer encoding for the HTML document:
<head>
<meta charset="UTF-8" />
</head>
Try it yourself
Browser Support
Syntax
<meta charset="character_set" />
Attribute Values
Value
Description
character_set
Created By www.ebooktutorials.blogspot.in
Example
Describe metadata within an HTML document:
<head>
<meta name="description" content="Free Web tutorials" />
<meta name="keywords" content="HTML,CSS,XML,JavaScript" />
</head>
Try it yourself
Browser Support
Syntax
<meta content="text" />
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
Refresh document every 30 seconds:
<head>
<meta http-equiv="refresh" content="30" />
</head>
Try it yourself
Browser Support
Syntax
<meta http-equiv="content-type|default-style|refresh" />
Attribute Values
Value
Description
content-type
default-style
refresh
Created By www.ebooktutorials.blogspot.in
Example
Use the name attribute to define a description, keywords, and the author of an HTML document:
<head>
<meta name="description" content="Free Web tutorials" />
<meta name="keywords" content="HTML5,CSS,JavaScript" />
<meta name="author" content="Hege Refsnes" />
</head>
Try it yourself
Browser Support
Syntax
<meta name="value" />
Attribute Values
Value
Description
application-name
Specifies the name of the Web application that the page represents
author
description
Specifies a description of the page. Search engines can pick up this description to
show with the results of searches.
Example: <meta name="description" content="Free web tutorials" />
generator
Specifies one of the software packages used to generate the document (not used
on hand-authored pages)
Example: <meta name="generator" content="FrontPage 4.0" />
keywords
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
form
New form_id
high
New number
low
New number
max
New number
min
New number
optimum
New number
value
New number
Global Attributes
The <meter> tag also supports the Global Attributes in HTML5.
Event Attributes
The <meter> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A <meter> element located outside a form (but still a part of the form):
Browser Support
Syntax
<meter form="form_id">
Attribute Values
Value
Description
form_id
Specifies a space-separated list of id's to one or more forms the meter element
belongs to
Created By www.ebooktutorials.blogspot.in
Example
A gauge with a current value and min, max, high, and low segments:
Browser Support
Syntax
<meter high="number">
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Example
A gauge with a current value and min, max, high, and low segments:
Browser Support
Syntax
<meter low="number">
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Example
A gauge with a current value and min, max, high, and low segments:
Browser Support
Syntax
<meter max="number">
Attribute Values
Value
Description
number
Specifies a floating point number that is the maximum value of the gauge.
Default value is "1"
Created By www.ebooktutorials.blogspot.in
Example
A gauge with a current value and min, max, high, and low segments:
Browser Support
Syntax
<meter min="number">
Attribute Values
Value
Description
number
Specifies a floating point number that is the minimum value of the gauge.
Default value is "0"
Created By www.ebooktutorials.blogspot.in
Example
A gauge with an optimal value of 0.5:
Browser Support
Syntax
<meter optimum="number">
Attribute Values
Value
Description
number
Specifies a floating point number that is the optimal value of the gauge
Created By www.ebooktutorials.blogspot.in
Example
A gauge with a current value and min, max, high, and low segments:
Browser Support
Syntax
<meter value="number">
Attribute Values
Value
Description
number
Required. Specifies a floating point number that is the current value of the gauge
Created By www.ebooktutorials.blogspot.in
<nav>
<a href="/html/">HTML</a> |
<a href="/html5/">HTML5</a> |
<a href="/css/">CSS</a> |
<a href="/css3/">CSS3</a> |
<a href="/js/">JavaScript</a>
</nav>
Try it yourself
Browser Support
The <nav> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <nav> tag.
Global Attributes
The <nav> tag also supports the Global Attributes in HTML5.
Event Attributes
The <nav> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript>Your browser does not support JavaScript!</noscript>
Try it yourself
Browser Support
<script type="text/javascript">
<!-function displayMsg()
{
alert("Hello World!")
}
//-->
</script>
Created By www.ebooktutorials.blogspot.in
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
Try it yourself
Browser Support
W3SCHOOLS EXAMS
The <object> tag defines an embedded object within an HTML document. Use this element to embed
multimedia (like audio, video, Java applets, ActiveX, PDF, and Flash) in your web pages.
You can also use the <object> tag to embed another webpage into your HTML document.
W3SCHOOLS BOOKS
You can use the <param> tag to pass parameters to plugins that have been embedded with the <object> tag.
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE
Share with
Attributes
: New in HTML5.
New
Attribute
Value
Description
align
left
right
top
bottom
archive
URL
border
pixels
classid
class_ID
codebase
URL
codetype
MIME_type
data
URL
declare
declare
form
New form_id
height
pixels
hspace
pixels
name
name
standby
text
type
MIME_type
usemap
#mapname
vspace
pixels
width
pixels
Global Attributes
The <object> tag also supports the Global Attributes in HTML5.
Event Attributes
The <object> tag also supports the Event Attributes in HTML5.
REPORT
W3Schools is optimized for learning, testing, and training. Examples might be simplifi
ERROR
HOME
TOP
FORUM
ABOUT
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
Example
How to use the <object> element to embed a Flash file:
Browser Support
Syntax
<object data="URL">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
An <object> element located outside a form (but still a part of the form):
Browser Support
Syntax
<object form="form_id">
Attribute Values
Value
Description
form_id
Created By www.ebooktutorials.blogspot.in
Example
A flash animation with a height and width of 400 pixels::
Browser Support
Syntax
<object height="pixels">
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
Example
An <object> element with a name attribute:
Browser Support
Syntax
<object name="name" />
Attribute Values
Value
Description
name
Created By www.ebooktutorials.blogspot.in
Example
An <object> element with a specified MIME type:
Browser Support
Syntax
<object type="MIME_type">
Attribute Values
Value
Description
MIME_type
Created By www.ebooktutorials.blogspot.in
Example
An <object> element using an image map:
Browser Support
The usemap attribute is supported in all major browsers, except Chrome and Safari.
Syntax
<object usemap="#mapname">
Attribute Values
Value
Description
#mapname
A hash character ("#") plus the name of the map element to use
Created By www.ebooktutorials.blogspot.in
Example
A flash animation with a height and width of 400 pixels::
Browser Support
Syntax
<object width="pixels">
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ol start="50">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ol reversed="reversed">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
reversed
Value
New reversed
Description
Specifies that the list order should be descending (9,8,7...)
start
number
type
1
A
a
I
i
Global Attributes
The <ol> tag also supports the Global Attributes in HTML5.
Event Attributes
The <ol> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
Descending list order:
<ol reversed="reversed">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Try it yourself
Browser Support
Syntax
<ol reversed="reversed">
Note: The reversed attribute is a boolean attribute, and can be set in the following ways:
<ol reversed>
<ol reversed="reversed">
<ol reversed="">
HTML5 <ol> tag
Created By www.ebooktutorials.blogspot.in
Example
An ordered list starting at "50":
<ol start="50">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Try it yourself
Browser Support
Syntax
<ol start="number">
Attribute Values
Value
Description
number
Specifies the start value of the first list item in the ordered list
Created By www.ebooktutorials.blogspot.in
Example
An ordered list with uppercase roman numbers:
<ol type="I">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Try it yourself
Browser Support
Syntax
<ol type="1|a|A|i|I">
Attribute Values
Value
Description
Created By www.ebooktutorials.blogspot.in
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="vw">VW</option>
<option value="audi">Audi</option>
</optgroup>
</select>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
label
text
disabled
disabled
Global Attributes
The <optgroup> tag also supports the Global Attributes in HTML5.
Event Attributes
The <optgroup> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
Two option groups with labels:
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="vw">VW</option>
<option value="audi">Audi</option>
</optgroup>
</select>
Try it yourself
Browser Support
Syntax
<optgroup label="text">
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
A disabled option-group:
Browser Support
Syntax
<optgroup disabled="disabled">
Note: The disabled attribute is a boolean attribute, and can be set in the following ways:
<optgroup disabled>
<optgroup disabled="disabled">
<optgroup disabled="">
HTML5 <optgroup> tag
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
Example
A drop-down list with one disabled option:
<select>
<option
<option
<option
<option
</select>
disabled="disabled" value="volvo">Volvo</option>
value="saab">Saab</option>
value="vw">VW</option>
value="audi">Audi</option>
Try it yourself
Browser Support
Syntax
<option disabled="disabled">
Note: The disabled attribute is a boolean attribute, and can be set in the following ways:
<option disabled>
<option disabled="disabled">
<option disabled="">
HTML5 <option> tag
Created By www.ebooktutorials.blogspot.in
Example
Use of the label attribute in <option> elements:
<select>
<option
<option
<option
<option
</select>
Try it yourself
Browser Support
Syntax
<option label="text">
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
A drop-down list with a pre-selected option:
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="vw">VW</option>
<option selected="selected" value="audi">Audi</option>
</select>
Try it yourself
Browser Support
Syntax
<option selected="selected">
Note: The selected attribute is a boolean attribute, and can be set in the following ways:
<option selected>
<option selected="selected">
<option selected="">
HTML5 <option> tag
Created By www.ebooktutorials.blogspot.in
Example
A drop-down list inside an HTML form:
<form action="demo_form.asp">
<select name="cars">
<option value="volvo">Volvo XC90</option>
<option value="saab">Saab 95</option>
<option value="mercedes">Mercedes SLK</option>
<option value="audi">Audi TT</option>
</select>
<input type="submit" value="Submit" />
</form>
Try it yourself
Browser Support
Syntax
<option value="value">
Attribute Values
Value
Description
value
Created By www.ebooktutorials.blogspot.in
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" name="a" value="50" />100
+<input type="number" name="b" value="50" />
=<output name="x" for="a b"></output>
</form>
Try it yourself
Browser Support
The <output> tag is supported in all major browsers, except Internet Explorer.
Attributes
New : New in HTML5.
Attribute
Value
Description
for
New element_id
form
New form_id
name
New name
Global Attributes
The <output> tag also supports the Global Attributes in HTML5.
Event Attributes
The <output> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <p> tag also supports the Global Attributes in HTML5.
Event Attributes
The <p> tag also supports the Event Attributes in HTML5
Created By www.ebooktutorials.blogspot.in
<object data="horse.wav">
<param name="autoplay" value="false">
</object>
Try it yourself
Browser Support
The <param> tag is supported in all major browsers. However, the file format defined in <object> may not be supported in all browsers.
Attributes
Attribute
Value
Description
name
name
type
MIME_type
value
value
valuetype
data
ref
object
Global Attributes
The <param> tag also supports the Global Attributes in HTML5.
Event Attributes
The <param> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
Set the "autoplay" parameter to "false", so the sound won't start playing as soon as the page loads:
<object data="horse.wav">
<param name="autoplay" value="false">
</object>
Try it yourself
Browser Support
The name attribute is supported in all major browsers. However, the file format defined in <object>
may not be supported in all browsers.
Syntax
<param name="name" />
Attribute Values
Value
Description
name
Created By www.ebooktutorials.blogspot.in
Example
Set the "autoplay" parameter to "false", so the sound won't start playing as soon as the page loads:
<object data="horse.wav">
<param name="autoplay" value="false">
</object>
Try it yourself
Browser Support
The value attribute is supported in all major browsers. However, the file format defined in <object>
may not be supported in all browsers.
Syntax
<param value="value" />
Attribute Values
Value
Description
value
Created By www.ebooktutorials.blogspot.in
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks
</pre>
Try it yourself
Browser Support
Global Attributes
The <pre> tag also supports the Global Attributes in HTML5.
Event Attributes
The <pre> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
max
New number
value
New number
Global Attributes
The <progress> tag also supports the Global Attributes in HTML5.
Event Attributes
The <progress> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
Downloading in progress:
Browser Support
Syntax
<progress max="number">
Attribute Values
Value
Description
number
A floating point number that specifies how much work the task requires in total
Created By www.ebooktutorials.blogspot.in
Example
Downloading in progress:
Browser Support
Syntax
<progress value="number">
Attribute Values
Value
Description
number
A floating point number that specifies how much of the task has been completed
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
Attribute
Value
Description
cite
URL
Global Attributes
The <q> tag also supports the Global Attributes in HTML5.
Event Attributes
The <q> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<ruby>
? <rt><rp>(</rp>??`<rp>)</rp></rt>
</ruby>
Try it yourself
Browser Support
The <rp> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <rp> tag.
Global Attributes
The <rp> tag also supports the Global Attributes in HTML5.
Event Attributes
The <rp> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<ruby>
? <rt> ??` </rt>
</ruby>
Try it yourself
Browser Support
The <rt> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <rt> tag.
Global Attributes
The <rt> tag also supports the Global Attributes in HTML5.
Event Attributes
The <rt> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<ruby>
? <rt> ??` </rt>
</ruby>
Try it yourself
Browser Support
The <ruby> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <ruby> tag.
Global Attributes
The <ruby> tag also supports the Global Attributes in HTML5.
Event Attributes
The <ruby> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <s> tag also supports the Global Attributes in HTML5.
Event Attributes
The <s> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<em>Emphasized text</em>
<strong>Strong text</strong>
<dfn>Definition term</dfn>
<code>Computer code</code>
<samp>Sample output from computer program</samp>
<kbd>Keyboard input</kbd>
<var>Variable</var>
Try it yourself
Browser Support
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags are supported in all major browsers.
Description
<em>
<strong>
<dfn>
<code>
<samp>
<kbd>
<var>
Defines a variable
Global Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Global Attributes in HTML5.
Event Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<script type="text/javascript">
document.write("Hello World!")
</script>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
async
New async
defer
defer
type
MIME_type
charset
character_set
src
URL
xml:space
preserve
Event Attributes
NONE
Created By www.ebooktutorials.blogspot.in
Example
A script that will be run asynchronously as soon as it is available:
Browser Support
The async attribute is supported in all major browsers, except Internet Explorer.
Syntax
<script async="async">
Note: The async attribute is a boolean attribute, and can be set in the following ways:
<script async>
<script async="async">
<script async="">
HTML5 <script> tag
Created By www.ebooktutorials.blogspot.in
Example
A script that will not run until after the page has loaded:
Browser Support
Syntax
<script defer="defer">
Note: The defer attribute is a boolean attribute, and can be set in the following ways:
<script defer>
<script defer="defer">
<script defer="">
HTML5 <script> tag
Created By www.ebooktutorials.blogspot.in
Example
A script with the type attribute specified:
<script type="text/javascript">
document.write("Hello World!")
</script>
Try it yourself
Browser Support
Syntax
<script type="MIME_type">
Attribute Values
Value
Description
MIME_type
Created By www.ebooktutorials.blogspot.in
Example
An external JavaScript with an UTF-8 character set:
Browser Support
Syntax
<script charset="character_set">
Attribute Values
Value
Description
character_set
Created By www.ebooktutorials.blogspot.in
Example
Point to an external JavaScript file:
Browser Support
Syntax
<script src="URL">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
<section>
<h1>WWF</h1>
<p>The World Wide Fund for Nature (WWF) is....</p>
</section>
Try it yourself
Browser Support
The <section> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <section> tag.
Global Attributes
The <section> tag also supports the Global Attributes in HTML5.
Event Attributes
The <section> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<select>
<option
<option
<option
<option
</select>
value="volvo">Volvo</option>
value="saab">Saab</option>
value="opel">Opel</option>
value="audi">Audi</option>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
New autofocus
autofocus
disabled
disabled
Description
Specifies that the drop-down list should automatically get focus when the page loads
Specifies that the drop-down list should be disabled
New form_id
multiple
multiple
name
text
size
number
form
Global Attributes
The <select> tag also supports the Global Attributes in HTML5.
Event Attributes
The <select> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <small> tag also supports the Global Attributes in HTML5.
Event Attributes
The <small> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<audio controls="controls">
<source src="song.ogg" type="audio/ogg" />
<source src="song.mp3" type="audio/mpeg" />
Your browser does not support the audio element.
</audio>
Try it yourself
Browser Support
The <source> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <source> tag.
Attributes
New : New in HTML5.
Attribute
Value
Description
media
New media_query
src
New URL
type
New MIME_type
Global Attributes
The <source> tag also supports the Global Attributes in HTML5.
Event Attributes
The <source> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
Use of the media attribute:
Browser Support
Syntax
<source media="value">
Possible Operators
Value
Description
and
not
Specifies an OR operator
Devices
Value
Description
all
aural
Speech synthesizers
braille
handheld
projection
Projectors
screen
Computer screens
tty
tv
Values
Value
Description
width
height
device-width
device-height
Created By www.ebooktutorials.blogspot.in
orientation
aspect-ratio
device-aspect-ratio
color
color-index
monochrome
resolution
scan
grid
Created By www.ebooktutorials.blogspot.in
Example
An audio player with two source files. The browser should choose which file (if any) it has support
for:
<audio controls="controls">
<source src="song.ogg" type="audio/ogg" />
<source src="song.mp3" type="audio/mpeg" />
Your browser does not support the audio element.
</audio>
Try it yourself
Browser Support
Syntax
<source src="URL">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
Use of the type attribute:
<audio controls="controls">
<source src="song.ogg" type="audio/ogg" />
<source src="song.mp3" type="audio/mpeg" />
Your browser does not support the audio element.
</audio>
Try it yourself
Browser Support
Syntax
<source type="MIME_type">
Attribute Values
Value
Description
MIME_type
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <span> tag also supports the Global Attributes in HTML5.
Event Attributes
The <span> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
<em>Emphasized text</em>
<strong>Strong text</strong>
<dfn>Definition term</dfn>
<code>Computer code</code>
<samp>Sample output from computer program</samp>
<kbd>Keyboard input</kbd>
<var>Variable</var>
Try it yourself
Browser Support
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags are supported in all major browsers.
Description
<em>
<strong>
<dfn>
<code>
<samp>
<kbd>
<var>
Defines a variable
Global Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Global Attributes in HTML5.
Event Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<html>
<head>
<style type="text/css">
h1 {color:red}
p {color:blue}
</style>
</head>
<body>
<h1>Heading</h1>
<p>A paragraph.</p>
</body>
</html>
Try it yourself
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
type
text/css
media
media_query
scoped
New scoped
Global Attributes
The <style> tag also supports the Global Attributes in HTML5.
Event Attributes
The <style> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
The <sub> and <sup> tags are supported in all major browsers.
Global Attributes
The <sub> tag also supports the Global Attributes in HTML5.
Event Attributes
The <sub> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<details>
<summary>Copyright 1999-2011.</summary>
<p> - by Refsnes Data. All Rights Reserved.</p>
<p>All content and graphics on this web site are the property of the company
Refsnes Data.</p>
</details>
Try it yourself
Browser Support
Global Attributes
The <summary> tag also supports the Global Attributes in HTML5.
Event Attributes
The <summary> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
border
""
1
cellpadding
pixels
cellspacing
pixels
frame
void
above
below
hsides
lhs
rhs
vsides
box
border
rules
none
groups
rows
cols
all
summary
text
width
pixels
%
Global Attributes
The <table> tag also supports the Global Attributes in HTML5.
Event Attributes
The <table> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
The following HTML table will be displayed with borders around the table cells:
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it yourself
Browser Support
Syntax
<table border="1">
Attribute Values
Value
Description
""
No borders around the table cells (the table could be used for layout purposes)
"1"
Add borders around the table cells (the table is NOT being used for layout
purposes)
Created By www.ebooktutorials.blogspot.in
<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
align
right
left
center
justify
char
char
character
charoff
number
valign
top
middle
bottom
baseline
Global Attributes
The <tbody> tag also supports the Global Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Event Attributes
The <tbody> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<table border="1">
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
abbr
text
align
left
right
center
justify
char
axis
category_name
char
character
charoff
number
colspan
number
headers
header_id
height
pixels
%
nowrap
nowrap
rowspan
number
scope
col
colgroup
row
rowgroup
valign
top
middle
bottom
baseline
width
pixels
%
Global Attributes
The <td> tag also supports the Global Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Event Attributes
The <td> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
An HTML table with a table cell that spans two columns:
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$100</td>
</tr>
<tr>
<td colspan="2">Sum: $180</td>
</tr>
</table>
Try it yourself
Browser Support
Syntax
<td colspan="number">
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Example
Specify the <th> element each <td> element is related to:
<table border="1">
<tr>
<th id="name">Name</th>
<th id="email">Email</th>
<th id="phone">Phone</th>
<th id="addr">Address</th>
</tr>
<tr>
<td headers="name">John Doe</td>
<td headers="email">someone@example.com</td>
<td headers="phone">+45342323</td>
<td headers="addr">Rosevn 56,4300 Sandnes,Norway</td>
</tr>
</table>
Try it yourself
Browser Support
The headers attribute has no visual effect in ordinary web browsers, but can be used by screen
readers.
Syntax
<td headers="header_id">
Attribute Values
Value
Description
header_id
Specifies a space-separated list of id's to one or more header cells the table cell
is related to
Created By www.ebooktutorials.blogspot.in
Example
An HTML table with a table cell that spans two rows:
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
<th>Savings for holiday!</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
<td rowspan="2">$50</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it yourself
Browser Support
Syntax
<td rowspan="number">
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
New autofocus
autofocus
Description
Specifies that a text area should automatically get focus when the page loads
cols
number
disabled
disabled
form
New form_id
maxlength
New number
name
text
New text
placeholder
readonly
readonly
required
New required
number
rows
New hard
soft
wrap
Global Attributes
The <textarea> tag also supports the Global Attributes in HTML5.
Event Attributes
The <textarea> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A text area with autofocus:
<textarea autofocus="autofocus">
At W3Schools you will find all the Web-building tutorials you need,
from basic HTML to advanced XML, SQL, ASP, and PHP.
</textarea>
Try it yourself
Browser Support
The autofocus attribute is supported in all major browsers, except Internet Explorer.
Syntax
<textarea autofocus="autofocus">
Note: The autofocus attribute is a boolean attribute, and can be set in the following ways:
<textarea autofocus>
<textarea autofocus="autofocus">
<textarea autofocus="">
HTML5 <textarea> tag
Created By www.ebooktutorials.blogspot.in
Example
A text area with a specified height and width:
Browser Support
Syntax
<textarea cols="number">
Attribute Values
Value
Description
number
Specifies the width of the text area (in average character width). Default value is
20
Created By www.ebooktutorials.blogspot.in
Example
A disabled text area:
<textarea disabled="disabled">
At W3Schools you will find all the Web-building tutorials you need,
from basic HTML to advanced XML, SQL, ASP, and PHP.
</textarea>
Try it yourself
Browser Support
Syntax
<textarea disabled="disabled">
Note: The disabled attribute is a boolean attribute, and can be set in the following ways:
<textarea disabled>
<textarea disabled="disabled">
<textarea disabled="">
HTML5 <textarea> tag
Created By www.ebooktutorials.blogspot.in
Example
A text area located outside a form (but still a part of the form):
Browser Support
The form attribute is supported in all major browsers, except Internet Explorer.
Syntax
<textarea form="form_id">
Attribute Values
Value
Description
form_id
Specifies a space-separated list of id's to one or more forms the text area
belongs to
Created By www.ebooktutorials.blogspot.in
Example
A text area with a maximum length of 50 characters:
<textarea maxlength="50">
Enter text here...
</textarea>
Try it yourself
Browser Support
The maxlength attribute is supported in all major browsers, except Internet Explorer and Opera.
Syntax
<textarea maxlength="number">
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Example
A text area with a name attribute:
<form action="demo_form.asp">
<textarea name="comment">Enter text here...</textarea>
<input type="submit" />
</form>
Try it yourself
Browser Support
Syntax
<textarea name="text">
Attribute Values
Value
Description
text
Created By www.ebooktutorials.blogspot.in
Example
A text area with a placeholder text:
Browser Support
The placeholder attribute is supported in all major browsers, except Internet Explorer.
Syntax
<textarea placeholder="text">
Attribute Values
Value
Description
text
Specifies a short hint that describes the expected value of the text area
Created By www.ebooktutorials.blogspot.in
Example
A read-only text area:
<textarea readonly="readonly">
At W3Schools you will find all the Web-building tutorials you need,
from basic HTML to advanced XML, SQL, ASP, and PHP.
</textarea>
Try it yourself
Browser Support
Syntax
<textarea readonly="readonly">
Note: The readonly attribute is a boolean attribute, and can be set in the following ways:
<textarea readonly>
<textarea readonly="readonly">
<textarea readonly="">
HTML5 <textarea> tag
Created By www.ebooktutorials.blogspot.in
Example
A form with a required text area:
<form action="demo_form.asp">
<textarea name="usrtxt" required="required"></textarea>
<input type="submit" />
</form>
Try it yourself
Browser Support
The required attribute is supported in all major browsers, except Internet Explorer and Safari.
Syntax
<textarea required="required">
Note: The required attribute is a boolean attribute, and can be set in the following ways:
<textarea required>
<textarea required="required">
<textarea required="">
HTML5 <textarea> tag
Created By www.ebooktutorials.blogspot.in
Example
A text area with a specified height and width:
Browser Support
Syntax
<textarea rows="number">
Attribute Values
Value
Description
number
Specifies the height of the text area (in lines). Default value is 2
Created By www.ebooktutorials.blogspot.in
Example
The text in a text area with wrap="hard" will contain newlines (if any) when submitted in a form:
Browser Support
Syntax
<textarea wrap="soft|hard">
Attribute Values
Value
Description
soft
The text in the textarea is not wrapped when submitted in a form. This is default
hard
Created By www.ebooktutorials.blogspot.in
<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
align
right
left
center
justify
char
char
character
charoff
number
valign
top
middle
bottom
baseline
Created By www.ebooktutorials.blogspot.in
Global Attributes
The <tfoot> tag also supports the Global Attributes in HTML5.
Event Attributes
The <tfoot> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
abbr
text
align
left
right
center
justify
char
axis
category_name
char
character
charoff
number
colspan
number
headers
header_id
height
pixels
%
nowrap
nowrap
rowspan
number
scope
col
colgroup
row
rowgroup
Specifies whether a header cell is a header for a column, row, or group of columns or rows
valign
top
middle
bottom
baseline
width
pixels
%
Global Attributes
The <th> tag also supports the Global Attributes in HTML5.
Event Attributes
Created By www.ebooktutorials.blogspot.in
The <th> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
An HTML table with a header cell that spans two columns:
<table>
<tr>
<th colspan="2">Month</th>
</tr>
<tr>
<td>January</td>
<td>February</td>
</tr>
</table>
Try it yourself
Browser Support
Syntax
<th colspan="number">
Attribute Values
Value
Description
number
Created By www.ebooktutorials.blogspot.in
Example
Specify the <th> element each header cell is related to:
<table>
<tr>
<th id="name" colspan="2">Name</th>
</tr>
<tr>
<th headers="name">Firsname</th>
<th headers="name">Lastname</th>
</tr>
</table>
Try it yourself
Browser Support
The headers attribute has no visual effect in ordinary web browsers, but can be used by screen
readers.
Syntax
<th headers="header_id">
Attribute Values
Value
Description
header_id
Specifies a space-separated list of id's to one or more header cells the header
cell is related to
Created By www.ebooktutorials.blogspot.in
Example
An HTML table with a header cell that spans three rows:
<table>
<tr>
<th>Month</th>
<th>Savings</th>
<th rowspan="3">Savings for holiday!</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it yourself
Browser Support
Syntax
<th rowspan="number">
Attribute Values
Value
Description
number
Sets the number of rows a header cell should span. Note: rowspan="0" tells the
browser to span the cell to the last row of the table section (thead, tbody, or
tfoot)
Created By www.ebooktutorials.blogspot.in
Example
Specify that the two header cells are headers for columns:
<table>
<tr>
<th></th>
<th scope="col">Month</th>
<th scope="col">Savings</th>
</tr>
<tr>
<td>1</td>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>2</td>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it yourself
Browser Support
The scope attribute has no visual effect in ordinary web browsers, but can be used by screen readers.
Syntax
<th scope="col|row|colgroup|rowgroup">
Attribute Values
Value
Description
col
row
colgroup
rowgroup
Created By www.ebooktutorials.blogspot.in
<table border="1">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
align
right
left
center
justify
char
char
character
charoff
number
valign
top
middle
bottom
baseline
Global Attributes
The <thead> tag also supports the Global Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Event Attributes
The <thead> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Attributes
New : New in HTML5.
Attribute
Value
Description
datetime
New datetime
pubdate
New pubdate
Global Attributes
The <time> tag also supports the Global Attributes in HTML5.
Event Attributes
The <time> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A time element with a date specified:
Browser Support
Syntax
<time datetime="YYYY-MM-DDThh:mm:ssTZD">
Attribute Values
Value
Description
YYYY-MM-DDThh:mm:ssTZD
Created By www.ebooktutorials.blogspot.in
Example
Specify the publication date of an <article> element:
<article>
<time datetime="2011-09-28" pubdate="pubdate"></time>
Hello world. This is an article....
</article>
Try it yourself
Browser Support
Syntax
<time pubdate="pubdate">
Attribute Values
Value
Description
pubdate
Created By www.ebooktutorials.blogspot.in
<html>
<head>
<title>HTML5 Tag Reference</title>
</head>
<body>
The content of the document......
</body>
</html>
Try it yourself
Browser Support
Global Attributes
The <title> tag also supports the Global Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<table border="1">
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>
Try it yourself
Browser Support
Attributes
Attribute
Value
Description
align
right
left
center
justify
char
char
character
charoff
number
valign
top
middle
bottom
baseline
Global Attributes
The <tr> tag also supports the Global Attributes in HTML5.
Event Attributes
The <tr> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
Optional Attributes
New : New in HTML5.
Attribute
Value
Description
default
New default
Specifies that the track is to be enabled if the user's preferences do not indicate that
another track would be more appropriate
kind
New captions
chapters
descriptions
metadata
subtitles
label
New text
src
New URL
srclang
New language_code
Global Attributes
The <track> tag also supports the Global Attributes in HTML5.
Event Attributes
The <track> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A video with two subtitle tracks. "English" subtitle is the default:
Browser Support
Syntax
<track src="subtitles_en.vtt" default="default">
Note: The default attribute is a boolean attribute, and can be set in the following ways:
<track default>
<track default="default">
<track default="">
HTML5 <track> tag
Created By www.ebooktutorials.blogspot.in
Example
A video with two subtitle tracks:
Browser Support
Syntax
<track src="subtitles_en.vtt" kind="subtitles" srclang="en">
Attribute Values
Value
Description
captions
The track defines translation of dialogue and sound effects (suitable for deaf
users)
chapters
The track defines chapter titles (suitable for navigating the media resource)
descriptions
The track defines a textual description of the video content (suitable for blind
users)
metadata
The track defines content used by scripts. Not visible for the user
subtitles
Created By www.ebooktutorials.blogspot.in
Example
A video with two subtitle tracks, both with a label defined:
Browser Support
Syntax
<track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="English">
Attribute Values
Value
Description
label
Created By www.ebooktutorials.blogspot.in
Example
A video with two subtitle tracks:
Browser Support
Syntax
<track src="subtitles_en.vtt">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
A video with two subtitle tracks:
Browser Support
Syntax
<track src="subtitles_en.vtt" kind="subtitles" srclang="en">
Attribute Values
Value
Description
language_code
Specifies a two-letter language code that specifies the language of the track text data
Created By www.ebooktutorials.blogspot.in
Created By www.ebooktutorials.blogspot.in
Browser Support
Global Attributes
The <u> tag also supports the Global Attributes in HTML5.
Event Attributes
The <u> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Try it yourself
Browser Support
Global Attributes
The <ul> tag also supports the Global Attributes in HTML5.
Event Attributes
The <ul> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
<em>Emphasized text</em>
<strong>Strong text</strong>
<dfn>Definition term</dfn>
<code>Computer code</code>
<samp>Sample output from computer program</samp>
<kbd>Keyboard input</kbd>
<var>Variable</var>
Try it yourself
Browser Support
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags are supported in all major
browsers.
Description
<em>
<strong>
<dfn>
<code>
<samp>
<kbd>
<var>
Defines a variable
Global Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Global
Attributes in HTML5.
Event Attributes
The <em>, <strong>, <dfn>, <code>, <samp>, <kbd>, and <var> tags also supports the Event
Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Browser Support
The <video> tag is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Note: Internet Explorer 8 and earlier versions, do not support the <video> tag.
Optional Attributes
New : New in HTML5.
Attribute
Value
Description
autoplay
New autoplay
controls
New controls
Specifies that video controls should be displayed (such as a play/pause button etc).
height
New pixels
loop
New loop
Specifies that the video will start over again, every time it is finished
muted
New muted
poster
New URL
Specifies an image to be shown while the video is downloading, or until the user hits
the play button
preload
New auto
metadata
none
Specifies if and how the author thinks the video should be loaded when the page
loads
src
New URL
width
New pixels
Global Attributes
The <video> tag also supports the Global Attributes in HTML5.
Event Attributes
The <video> tag also supports the Event Attributes in HTML5.
Created By www.ebooktutorials.blogspot.in
Example
A video that will automatically start playing:
Browser Support
Syntax
<video autoplay="autoplay">
Note: The autoplay attribute is a boolean attribute, and can be set in the following ways:
<video autoplay>
<video autoplay="autoplay">
<video autoplay="">
HTML5 <video> tag
Created By www.ebooktutorials.blogspot.in
Example
A <video> element with browser default controls:
<video controls="controls">
<source src="movie.mp4" type="video/mp4" />
<source src="movie.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
Try it yourself
Browser Support
Syntax
<video controls="controls">
Note: The controls attribute is a boolean attribute, and can be set in the following ways:
<video controls>
<video controls="controls">
<video controls="">
HTML5 <video> tag
Created By www.ebooktutorials.blogspot.in
Example
A video player with a specified height and width:
Browser Support
Syntax
<video height="pixels">
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
Example
A video that will start over again, every time it is finished:
Browser Support
Syntax
<video loop="loop">
Note: The loop attribute is a boolean attribute, and can be set in the following ways:
<video loop>
<video loop="loop">
<video loop="">
HTML5 <video>
Created By www.ebooktutorials.blogspot.in
Example
A muted video:
Browser Support
The muted attribute is supported in all major browsers, except Internet Explorer and Safari.
Syntax
<video muted="muted">
Note: The muted attribute is a boolean attribute, and can be set in the following ways:
<video muted>
<video muted="muted">
<video muted="">
HTML5 <video> tag
Created By www.ebooktutorials.blogspot.in
Example
A video player with a poster image:
Browser Support
Syntax
<video poster="URL">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
Author thinks that the video should NOT be loaded when the page loads:
Browser Support
The preload attribute is supported in all major browsers, except Internet Explorer.
Syntax
<video preload="auto|metadata|none">
Attribute Values
Value
Description
auto
The author thinks that the browser should load the entire video when the page
loads
metadata
The author thinks that the browser should load only metadata when the page
loads
none
The author thinks that the browser should NOT load the video when the page
loads
Created By www.ebooktutorials.blogspot.in
Example
Play a video:
Browser Support
The src attribute is supported in all major browsers. However, the file format defined may not be
supported in all browsers.
Note: Internet Explorer 8 and earlier versions, do not support the <video> tag.
Example
<video width="320" height="240" controls="controls">
<source src="movie.mp4" type="video/mp4" />
<source src="movie.ogg" type="video/ogg" />
Your browser does not support the video tag.
</video>
Try it yourself
Syntax
<video src="URL">
Attribute Values
Value
Description
URL
Created By www.ebooktutorials.blogspot.in
Example
A video player with a specified width and height:
Browser Support
Syntax
<video width="pixels">
Attribute Values
Value
Description
pixels
Created By www.ebooktutorials.blogspot.in
<p>
To learn AJAX, you must be familiar with the XML<wbr>Http<wbr>Request
Object.
</p>
Try it yourself
Browser Support
The <wbr> tag is supported in all major browsers, except Internet Explorer.
Global Attributes
The <wbr> tag also supports the Global Attributes in HTML5.
Event Attributes
The <wbr> tag also supports the Event Attributes in HTML5.