Created
July 9, 2017 00:59
-
-
Save devilshaircut/cef07f1563ff83aeb9c11288661ca292 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var tasks = [ "Drink Coffee", "Eat Donuts", "Go to Gym" ]; | |
var loadTasks = function(myTasks) { | |
for (var i=0; i < myTasks.length; i++) { | |
$("#to-do").append("<li>" + myTasks[i] + "</li>"); | |
} | |
} | |
var unloadTasks = function() { | |
$("#to-do").empty(); | |
}; | |
loadTasks(tasks); | |
var myFunction = function() { | |
// $("#to-do").append("<li>" + $("#new-to-do").val() + "</li>"); | |
tasks.push($("#new-to-do").val()); | |
unloadTasks(); | |
loadTasks(tasks); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment