29 lines
660 B
HTML
29 lines
660 B
HTML
|
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Test Storage</title>
|
||
|
<script language="JavaScript">
|
||
|
var sema=0;
|
||
|
function saveSecret() {
|
||
|
if (sema==111111111){
|
||
|
|
||
|
var secret = document.getElementById('SecretData').value;
|
||
|
localStorage.setItem('userdata',secret);
|
||
|
|
||
|
var yoursec = document.getElementById('YourSec');
|
||
|
yoursec.innerHTML = 'Your Secret is : ' + localStorage.userdata;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<form name="f1" id="form1" action="">
|
||
|
<p><b>Enter Data <input type="password" id="SecretData" />
|
||
|
<input type="submit" value="Show" action="saveSecret()">
|
||
|
</form>
|
||
|
<p id="YourSec"></p>
|
||
|
</body>
|
||
|
</html>
|