# JavaScript Code function save() { // 1. add input box contents to list var value = $('#todo-name').val(); var element = $("
  • " + value + "
  • "); $('#todo-list').append(element); // 2. hide form and show add button $('#new-todo-form').hide(); $('#add-button').show(); // 3. send contents to server $.get('http://localhost:8124', value, function(data, status){ }); } $(document).ready(function() { $('#add-button').click(function(event) { $('#new-todo-form').show(); $('#add-button').hide(); $('#todo-name').focus(); }); }); # HTML Todo

    Todo List