Created
October 12, 2020 10:56
-
-
Save ihzarizkyk/f4fbbb3d8762501698b5d24b6d1024ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>LocalStorage HTML5 - FWD</title> | |
<script> | |
function save() | |
{ | |
var storage = document.getElementById('inputan').value; | |
localStorage.setItem('Text',storage); | |
} | |
function show() | |
{ | |
var showinputan = localStorage.getItem('Text'); | |
if(showinputan) | |
{ | |
sw = document.getElementById('show'); | |
sw.innerHTML=showinputan; | |
} | |
} | |
function del() | |
{ | |
localStorage.removeItem('Text'); | |
} | |
</script> | |
</head> | |
<body> | |
<!--Local Storage HTML5--> | |
<h1> | |
Inputan Teks | |
</h1> | |
<input type="text" id="inputan"> | |
| |
<input type="button" value="SIMPAN" onclick="save()"> | |
| |
<input type="button" value="TAMPILKAN" onclick="show()"> | |
| |
<input type="button" value="HAPUS" onclick="del()"> | |
<br> | |
<p id="show"></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment