Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
David

Chapter 4 -- To-Do List -- Edit Or Delete List Entries

Recommended Posts

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

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...