HTML 5 ToDo List

I needed a simple to-do list for my Nexus One.  A quick look in the Android Market turned up a lot of options that were far more complicated than I wanted.   My solution was  a quick offline HTML 5 app with local storage. When you type in the textarea, the text gets stored to the local name/value store.  Saving is triggered by each key-up event which is probably excessive, but it works fine. Here’s the code:

<!DOCTYPE html>
<html manifest="cache.manifest">
<head>
    <meta http-equiv="Content-Type"
         content="text/html;charset=utf-8" >
    <title>List</title>
    <script type="text/javascript" src="jquery.min.js"></script>
    <script type="text/javascript">

        $(document).ready(function() {
            $("#myText").text(localStorage.getItem("list"));
        });

        function saveText() {
            localStorage.setItem("list", $("#myText").val());
        }

    </script>
</head>

<body>
    <form action="">
        <textarea cols="33" rows="20" id="myText"
              onkeyup="saveText()"></textarea>
    </form>
</body>
</html>

And the manifest

CACHE MANIFEST

jquery.min.js

Follow

Get every new post delivered to your Inbox.