HTML
HTML
What is HTML?
HTML stands for Hyper Text Markup Language
HTML is the standard markup language for creating Web pages
HTML describes the structure of a Web page
HTML consists of a series of elements
HTML elements tell the browser how to display the content
HTML elements label pieces of content such as "this is a heading", "this is
a paragraph", "this is a link", etc.
HTML Attributes
HTML attributes provide additional information about HTML elements.
HTML Attributes
All HTML elements can have attributes
Attributes provide additional information about elements
Attributes are always specified in the start tag
Attributes usually come in name/value pairs like: name="value"
The href Attribute
The <a> tag defines a hyperlink. The href attribute specifies the URL of the page
the link goes to
What is XHTML?
XHTML stands for EXtensible HyperText Markup Language
XHTML is a stricter, more XML-based version of HTML
XHTML is HTML defined as an XML application
XHTML is supported by all major browsers
Why XHTML?
XML is a markup language where all documents must be marked up correctly
(be "well-formed").
XHTML was developed to make HTML more extensible and flexible to work with
other data formats (such as XML). In addition, browsers ignore errors in HTML
pages, and try to display the website even if it has some errors in the markup.
So XHTML comes with a much stricter error handling.
When a web browser reads an HTML document, browser reads it from top to
bottom and left to right. HTML tags are used to create HTML documents and
render their properties. Each HTML tags have different properties.
An HTML file must have some essential tags so that web browser can
differentiate between a simple text and HTML text. You can use as many
tags you want as per your code requirement.
o All HTML tags must enclosed within < > these brackets.
o Every tag in HTML perform different tasks.
o If you have used an open tag <tag>, then you must use a close tag </tag>
(except some tags)
Syntax
<tag> content </tag>
HTML Form
An HTML form is a section of a document which contains controls such as
text fields, password fields, checkboxes, radio buttons, submit button, menus
etc.
An HTML form facilitates the user to enter data that is to be sent to the
server for processing such as name, email address, password, phone
number, etc. .
For example: If a user want to purchase some items on internet, he/she must
fill the form such as shipping address and credit/debit card details so that
item can be sent to the given address.
Tag Description
The DHTML application was introduced by Microsoft with the release of the
4th version of IE (Internet Explorer) in 1997.
47.9M
866
Next
Stay
o HTML 4.0
o CSS
o JavaScript
o DOM.
HTML 4.0
CSS
CSS stands for Cascading Style Sheet, which allows the web users or
developers for controlling the style and layout of the HTML elements on the
web pages.
JavaScript
DOM
Uses of DHTML
Following are the uses of DHTML (Dynamic HTML):
o It is used for designing the animated and interactive web pages that are
developed in real-time.
o DHTML helps users by animating the text and images in their documents.
o It allows the authors for adding the effects on their pages.
o It also allows the page authors for including the drop-down menus or rollover
buttons.
o This term is also used to create various browser-based action games.
o It is also used to add the ticker on various websites, which needs to refresh
their content automatically.
Features of DHTML
Following are the various characteristics or features of DHTML (Dynamic
HTML):
o Its simplest and main feature is that we can create the web page
dynamically.
o Dynamic Style is a feature, that allows the users to alter the font, size,
color, and content of a web page.
o It provides the facility for using the events, methods, and properties. And,
also provides the feature of code reusability.
o It also provides the feature in browsers for data binding.
o Using DHTML, users can easily create dynamic fonts for their web sites or
web pages.
o With the help of DHTML, users can easily change the tags and their
properties.
o The web page functionality is enhanced because the DHTML uses low-
bandwidth effect.
2. It is used for developing and creating 2. It is used for creating and designing the
web pages. animated and interactive web sites or pages.
3. This markup language creates static 3. This concept creates dynamic web pages.
web pages.
4. It does not contain any server-side 4. It may contain the code of server-side
scripting code. scripting.
5. The files of HTML are stored with 5. The files of DHTML are stored with
the .html or .htm extension in a system. the .dhtm extension in a system.
6. A simple page which is created by a 6. A page which is created by a user using the
user without using the scripts or styles HTML, CSS, DOM, and JavaScript technologies
called as an HTML page. called a DHTML page.
7. This markup language does not need 7. This concept needs database connectivity
database connectivity. because it interacts with users.
o Inline CSS: Define CSS properties using style attribute in the HTML
elements.
o Internal or Embedded CSS: Define CSS using <style> tag in
<head> section.
o External CSS: Define all CSS property in a separate .css file, and then
include the file with HTML file using tag in section.
HTML Event Attributes
When a browser reacts on user action, then it is called as an event. For example, when yo
In HTML5 there are lots of event attributes available which can be activated using a progr
Following is a table of event attributes, using these attributes you can perform several eve
Attribute Description
onhashchang Executed the script when the anchor part in URL of the webpage is
e changed.
onoffline Executed the script when the network connection is disconnected, and
browser started working offline.
ononline Executed the script when the browser started working online
onpagehide Executed the script when the current webpage is hidden such as if the
user has moved away from the current webpage.
onpopstate Executed the script when the window's active history is changed.
onunload Executed the script when the current webpage is unloaded, or window
is closed.
The form events can be used with any element, but these are mainly used with HTML form
Attribute Description
onblur Executed the script when form element loses the focus.
onchange Executed the script when the value of the element is changed.
oninput Executed the script when the user enters input to the element.
oninvalid Executed the script when the element does not satisfy its predefined
constraints.
onreset Triggers the event when user reset the form element values.
onsearch Triggers the event when a search field receives some input.
onselect Triggers the event when the user has selected some text.
event.
Attribute Description
onkeydow Triggers the event when the user presses down a key on the keyboard.
n
onkeypres Trigger the event when the user presses the key which displays some
s character.
onkeyup Trigger the event when the user releases the currently pressed key.
Attribute Description
onclick Trigger the event when the mouse clicks on the element.
ondblclick Trigger the event when mouse double-click occurs on the element.
onmousedown Trigger the event when the mouse button is pressed on the element.
onmousemove Trigger the event when the mouse pointer moves over the element.
onmouseout Trigger the event when the mouse moves outside the element.
onmouseover Trigger the event when the mouse moves onto the element.
onwheel Trigger the event when the mouse wheel rolls up or down on the
element
Attribute Description
oncopy Trigger the event when the user copies the content to the system clipboard.
oncut Trigger the event when the content of an element is cut and copy to the
clipboard.
onpaste Trigger the event when the user pastes some content in an element.
Attribute Description
oncanplay Executed the script when the media file is ready to play.
oncanplaythrou Executed the script when the media file is ready to play without
gh buffering or stopping.
ondurationchan Executed the script when the media file duration is changed.
ge
onemptied Executed the script if media occurs some fatal error, and the file
becomes unavailable.
onended Executed the script when the media file occurs its end point.
onerror Executed the script when some error occurred while fetching the media
data.
onplay Executed the script when media file ready to play after being paused.
onprogress Executed the script when the browser is in the process of getting the
media data.
onseeked Executed the script when seek operation is ended and seeking attribute
is set to false.
onseeking Executed the script when seek operation is active and seeking attribute
is set to true.
onstalled Executed the script when browser unexpectedly stopped fetching the
data media.
onwaiting Executed the script if playback pause to wait for loading more data.