SHOW:
|
|
- or go back to the newest paste.
| 1 | <!DOCTYPE html> | |
| 2 | <html> | |
| 3 | <head> | |
| 4 | <title> | |
| 5 | To-Do List | |
| 6 | </title> | |
| 7 | <script type="text/javascript"> | |
| 8 | function saveEdits() {
| |
| 9 | //get the editable element | |
| 10 | var editElem = document.getElementById("edit");
| |
| 11 | //get the edited element content | |
| 12 | var userVersion = editElem.innerHTML; | |
| 13 | //save the content to local storage | |
| 14 | localStorage.userEdits = userVersion; | |
| 15 | } | |
| 16 | function checkEdits() {
| |
| 17 | //find out if the user has previously saved edits | |
| 18 | if(localStorage.userEdits!=null) | |
| 19 | document.getElementById("edit").innerHTML=localStorage.userEdits;
| |
| 20 | } | |
| 21 | window.onbeforeunload = function() {saveEdits()}
| |
| 22 | setInterval(function(){saveEdits()},30000);
| |
| 23 | </script> | |
| 24 | <style> | |
| 25 | body {
| |
| 26 | background-color:floralwhite; | |
| 27 | } | |
| 28 | #edit {
| |
| 29 | border-style:dotted; | |
| 30 | border-width:1px; | |
| 31 | position:absolute; | |
| 32 | top:40px; | |
| 33 | width: 80%; | |
| 34 | font-family:"Andale Mono", Helvetica, sans-serif; | |
| 35 | font-size:200%; | |
| 36 | background-color:white; | |
| 37 | min-height:40px; | |
| 38 | } | |
| 39 | #stuff {
| |
| 40 | width: 80%; | |
| 41 | margin-left:auto; | |
| 42 | margin-right:auto; | |
| 43 | } | |
| 44 | </style> | |
| 45 | </head> | |
| 46 | <body onload="checkEdits()"> | |
| 47 | <div id="stuff"> | |
| 48 | - | |
| 48 | + | |
| 49 | ||
| 50 | </div> | |
| 51 | </div> | |
| 52 | - | </html> |
| 52 | + | |
| 53 | </html> |