HTML5-Session Storage Example

Definition :      Session storage hold the data still the end of user session storage. Program : <html>    <script>      a=1;                    function display()                    {                     if(typeof(Storage)!=”undefined”) {                                 if(sessionStorage.clickCount) {                                 sessionStorage.clickCount=Number(sessionStorage.clickcount)+1;                                 } else {                                 sessionStorage.clickcount=1;                                 }                                 document.getElementById(“result”).innerHTML=you have clicked …

HTML5-Local Storage Examples

Definition :       Local storage is an object which is meant for which holds the data till the web pages refreshed. Program 1 : <html>    <body>       <div id=”result”> </div>                      <script>                                    if(typeof(Storage)!==”undefined”){                                    localStorage.setItem(“lastname”,”testing”);                                    document.getElementById(“result”).innerHTML=localStorage.getItem(“lastname”);                                    }else{                                    document.getElementById(“result”).innerHTML=”sorry,your …

HTML5-Custom Tag Example

Definition :    This is a tag which is created by the user during run time of the program then it is called as custom tag. Program : <html>      <head>                      <script> document.createElement(“my hero”) </script>                                  <style>                                     myHero {                                                 display:block;                                                 background-color:#ddd;                                                 padding:50px;                                                 …

HTML5-Canvas Examples

Definition :     Canvas is a container which is meant for loading the content dynamically on the web page. Program 1 : <html>      <body>                      <canvas id=”mycanvas” width=”200″ height=”100″ style=”border:1px solid#d3d3d3;”>                                  your browser does not support the HTML5 canvas tag. </canvas>                                 <script>                                      var c=document.getElementById(“mycanvas”); …

HTML5-SVG Examples

Definition : Svg stands for scalable vector graphics. Svg is used to define graphics for the web. Svg is a W3C recommendation. Svg has several methods for drawing paths, boxes, circles, text, and graphic images. Program 1 : <html>      <body>                     <svg version=”1.1″ xmlns=”http://www.w3.org/2000/svg” viewBox=”0 0 800 300″> …

HTML5- Navigator Example

Definition : Navigator is display the our current location purpose to use. Program 1 : <html>      <body>                     <button onclick=”getLocation()”> Get Details </button>                                 <p id=”demo”> </p>                                 <script>                                      var x=document.getElementById(“demo”);                                                  function getLocation() {                                                  if(navigator.getLocation) {                                                  navigator.getLocation.getCurrentposition(showposition);                                                  } else {                                                  x.innerHTML=”GeoLocation …

Input Components Examples in HTML

Definition : These are the components which are meant for taking the input as well as displaying the  output on the webpage. Program : <html>      <body>                      <input type=”text”/> <br>                                  <input type=”text” readonly/> <br>                                  <input type=”text” value=”enter some value”/> <br>                                  <input type=”text” value=”enter some value”/> …

Pre Tag Examples in HTML

Definition : Pre  tag stands for predefined. This is a tag which is meant for displaying the content in predefined passion on the webpage. Program : <html>      <body>                      <pre>            hello                                            hi                                                 h r u </pre>                 </body> </html>

P Tag Examples in HTML

Definition : this is a tag which is meant for displaying the content in the form of a paragraph on the webpage & nbsp stands for no breaking space Program : <html>      <body>                       <p align=”left”> Hello </p>                                   <p> &nbsp; </p>                                   <p align=”right”> Hello …

Address Tag Examples in HTML

Definition : this is a tag which is meant for displaying huge set of addresses as a partitions on the webpage. Program : <html>      <body>                       <address> my address                                        <details>                                                          <summary> Home Address </summary>                                                                                  <p> Home details goes here </p>                                                                 </details>                                                                 …