About HTML
About HTML
1
Copyright © 2013 Tech Mahindra. All rights reserved. 2
Copyright © 2013 Tech Mahindra. All rights reserved. 3
What is meant by DOM?
The Document Object Model (DOM) provides another way to represent, store
and manipulate that same document. The DOM is a fully object-oriented
representation of the web page, and it can be modified with a scripting
language such as JavaScript.
HTML5 is not based on SGML, and therefore does not require a reference to a
DTD.
<!DOCTYPE html>
<html>
<head>
<title>Nested Elements Example</title>
</head>
<body>
<h1></h1>
<p>This is <em>emphasis </em> and
<strong>Paragraph</strong></p>
</body>
</html>
A block-level element always starts on a new line and takes up the full
width available (stretches out to the left and right as far as it can). It
create a "Block" or "Box"
Inline Inline
An inline element does not start on a new line and only takes up as
much width as necessary.
Inline Inline
<!doctype html>
<meta charset="UTF-8“>
With local storage, web applications can store data locally within the user's
browser.
Before HTML5, application data had to be stored in cookies, included in every
server request. Local storage is more secure, and large amounts of data can
be stored locally, without affecting website performance.
Unlike cookies, the storage limit is far larger (at least 5MB) and information is
never transferred to the server.
Local storage is per origin (per domain and protocol). All pages, from one
origin, can store and access the same data.
Store
localStorage.setItem("lastname", "Smith");
Retrieve
document.getElementById("result").innerHTML =
localStorage.getItem("lastname");
Store
sessionStorage.setItem("lastname", "Smith");
Retrieve
document.getElementById("result").innerHTML =
sessionStorage.getItem("lastname");