SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Todo list.

  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Todo list.

    Is it possible to do a HTML todos list? I hear it requires database or some way of storing the info.

    I want to Make a simple html page to manage Todos. It should have an input field. When the user enters text in the input field, show that input in the page. When an existing item is clicked, it should disappear from the page.

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <script>
    function addText(){
        var input = document.getElementById('post').value;
        document.getElementById('this').innerHTML += " " + input;
    }
    </script>
    </head>
    <body>
    
    <p onclick='remove()' id="this"> </p>
    <input type='text' id='post'/>
    <input type='button' onclick='addText()' value='Enter Text'/>
    
    </body>
    </html>


    Why is when I click the previous post it deletes the entire Paragraph instead of just one at time when click. and also once I delete something it doesn't allow me to re post
    I want to make it so onclick with the mouse on the input text it deletes it from the rows and then allow me to repost something. someone help me please.

  2. #2
    SitePoint Member
    Join Date
    May 2012
    Posts
    10
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You should read this article: http://www.javascriptkit.com/javatut...mstorage.shtml

    Then scroll to the bottom of the page and you'll find something very close to what you are looking for. It will be fun to make modifications to it to make it do what you want. It uses list items, but you can easily adjust accordingly to suite your needs.

  3. #3
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,109
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    You should checkout http://todomvc.com/ which shows how to build a todo app client-side using all of the popular frameworks.
    It's possible to do it without a framework but it will not be as elegant as some of those.

  4. #4
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Try developing Todo app with XML.
    Quality codes are optimized and tested...
    Click here for inspiration..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •