To-do List App – JavaScript Tutorial for Beginners




Hopefully by now you’re getting better at JavaScript. In order to apply the basic programming concepts we’ve discussed so far, let’s build a useful to do list web-based application.

Copyright (c) 2013 Rodrigo Silveira http://www.easylearntutorial.com

Original source


9 responses to “To-do List App – JavaScript Tutorial for Beginners”

  1. I noticed that in this tutorial before you get rid of the button option, you have it declared as a global variable, yet you also note that this is a bad practice.  My question would be :

    How else could you use the btnNew.onclick  without initially declaring btnNew as a global variable or outside of the function using it to perform an action?

    Would you wrap the entire thing in an anonymous function or would you instead not even declare btnNew as a variable but instead use :

    document.getElementById("todoList").onclick = function()
    {
      //function contents would go in here for when the button with id "todoList" is clicked.
    };

    My thoughts would be that unless you plan on doing other actions when that button is clicked.. simply pointing to it as i did above would be best.  however if you wanted to use it again elsewhere.. would that justify declaring it as a Global Variable?

Leave a Reply