diff --git a/JavaScript/Advance/Web API/web-storage API/images/js-logo.png b/JavaScript/Advance/Web API/web-storage API/images/js-logo.png new file mode 100644 index 0000000..4637ac9 Binary files /dev/null and b/JavaScript/Advance/Web API/web-storage API/images/js-logo.png differ diff --git a/JavaScript/Advance/Web API/web-storage API/index.html b/JavaScript/Advance/Web API/web-storage API/index.html new file mode 100644 index 0000000..89fb533 --- /dev/null +++ b/JavaScript/Advance/Web API/web-storage API/index.html @@ -0,0 +1,26 @@ + + + +
+ + + +Used for Storing Data Permanently
+Used for Storing Data Short Time
+ ` +} + +// Example One localStorage() + +let textTwo = document.getElementById('textTwo'); + +function DisplayTwo() { + localStorage.setItem("name", "Azhar"); + textTwo.innerHTML = localStorage.getItem("name"); +} + +// Example Two sessionStorage() + +let textThree = document.getElementById('textThree'); + +function DisplayThree() { + sessionStorage.setItem("name", "Musharraf"); + textThree.innerHTML = sessionStorage.getItem("name"); +} \ No newline at end of file