Created
November 3, 2016 13:34
-
-
Save Marahin/4634d76be3c9ae7a04334da45ce739b0 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
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js"> </script> | |
</head> | |
<body> | |
<form> | |
<input type="text" id="wejscie_zapisywane" style="width: 100%;" /> | |
</form> | |
<!-- logika --> | |
<script> | |
$(document).ready(function(){ | |
$('#wejscie_zapisywane').val( | |
localStorage.getItem('wejscie_zapisane') || 'Cokolwiek tu wpiszesz zostanie zapisane.' | |
); | |
$('#wejscie_zapisywane').on('change', function(){ | |
localStorage.setItem("wejscie_zapisane", $('#wejscie_zapisywane').val()); | |
}); | |
}); | |
</script> | |
<!-- . . . --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment