HTML 05
HTML 05
Lecture #03
Course Instructor: Engr. Samina
Bilquees
HTML5 - New Features
Some of the most interesting new features in HTML5:
New Semantic Elements: These are like <header>,
<footer>, and <section>.
Forms 2.0: Improvements to HTML web forms where
new attributes have been introduced for <input> tag.
WebSocket : A next-generation bidirectional
communication technology for web applications.
Server-Sent Events: HTML5 introduces events
which flow from web server to the web browsers and
they are called Server-Sent Events (SSE).
Canvas: This supports a two-dimensional drawing
surface that you can program with JavaScript.
HTML5 - New Features
Audio & Video: You can embed audio or
video on your web pages without resorting to
third-party plugins.
Geolocation: Now visitors can choose to
share their physical location with your web
application.
Microdata: This lets you create your own
vocabularies beyond HTML5 and extend your
web pages with custom semantics.
Drag and drop: Drag and drop the items
from one location to another location on the
same webpage.
The autofocus attribute of <input>
This is a simple one-step pattern, easily
programmed in JavaScript at the time of
document load, automatically focus one
particular form field.
HTML5 introduced a new attribute called
autofocus which would be used as follows:
<input type="text" name="search" autofocus/>
The required attribute
Now you do not need to have javascript for client
side validations like empty text box would never
be submitted because HTML5 introduced a new
attribute called required which would be used as
follows and would insist to have a value:
<input type="text" name="search" required/>
New Elements in HTML5
HTML5 <article> Tag
The <article> tag specifies independent, self-contained
content.
An article should make sense on its own and it should be
possible to distribute it independently from the rest of the
site.
Potential sources for the <article> element:
Forum post
Blog post
News story
Comment
<article>a
<h1>Internet Explorer 9</h1>
<p>Windows Internet Explorer 9 (abbreviated as IE9) was
released
to the public on March 14, 2011 at 21:00 PDT.....</p>
</article>
The Placeholder attribute
HTML5 introduced a new attribute
called placeholder. This attribute on
<input> and <textarea> elements provides a
hint to the user of what can be entered in the
field.
Enter email : <input type="email"
name="newinput"
placeholder="[email protected]"/>
<input type="submit" value="submit" />
New Elements in HTML5
HTML5 <datalist> Tag
The <datalist> tag specifies a list of pre-
defined options for an <input> element.
The <datalist> tag is used to provide an
"autocomplete" feature on <input> elements.
Users will see a drop-down list of pre-defined
options as they input data.
Use the <input> element's list attribute to
bind it together with a <datalist> element.
New Elements in HTML5
HTML5 <datalist> Tag
<input type="text" list="browsers"
name="browser" />
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
New Elements in HTML5
HTML5 <details> Tag
The <details> tag specifies additional details
that the user can view or hide on demand.
The <details> tag can be used to create an
interactive widget that the user can open and
close. Any sort of content can be put inside
the <details> tag.
The content of a <details> element should
not be visible unless the open attribute is set.
New Elements in HTML5
HTML5 <details> Tag
<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>
New Elements in HTML5
HTML5 <embed> Tag
The <embed> tag defines a container for an
external application or interactive content (a
plug-in).
<embed src="helloworld.swf" />
Attribute Value Description