David Posted November 21, 2012 Share Posted November 21, 2012 The script for the To-Do List in chapter 4 (page 204) allows for adding new list entries, but no way to edit or delete (and maybe re-order) the entries after they've been entered. Since the data is only stored in a client-side array, can those element values be accessed for editing? ~ David Link to comment Share on other sites More sharing options...
Larry Posted November 21, 2012 Share Posted November 21, 2012 Yes, you can access them as they are stored in a client-side array, but only for the duration of the browser session (i.e., as long as that window is open). Link to comment Share on other sites More sharing options...
HartleySan Posted November 21, 2012 Share Posted November 21, 2012 Yes, you can access the array for editing or deleting purposes in the same way that you accessed it for adding entries. Simply write a JS event handler that handles a button click and then attach a function to that button that either edits or deletes the array as need be, and then display the new array results on the screen in whatever fashion you want. Link to comment Share on other sites More sharing options...
Recommended Posts