Press "Enter" to skip to content

HTML5-Session Storage Example

Last updated on October 5, 2019

Definition :

     Session storage hold the data still the end of user session storage.

Program :




                   function display()


                    if(typeof(Storage)!=”undefined”) {

                                if(sessionStorage.clickCount) {


                                } else {



                                document.getElementById(“result”).innerHTML=you have clicked the button”+sessionStorage.clickCount+”time(s) in this session.”;

                                } else {

                                document.getElementById(“result”).innerHTML=”sorry, your browser does not support web storage…”;





                                  <button onClick=”display()”> click me </button>

                                  <div id=”result”> </div>



Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *