Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript Make Delete and Edit Buttons Work

dimer16

Coder
Please help me to finish my To Do App:
Add click event on button “Remove” - So that by click on button "REMOVE" created item would be removed from localstorage as well.
Add click event on button “Edit” - So that created item could be edited in localstorage as well.
Thank you a lot for your time and effort.

CLICK HERE TO SEE MY CODE
 
I dont know how to do it. Its not an assignment its just my pet project for myself. I started to learn js 2 month ago and its really tough for me. I was thinking that in this forum someone could help me by showing how i can make them buttons work.
 
What is the problem with deleting an element from localstorage ? Is localStorage.removeItem(key); not working ? Did you check the console log for messages ?
As for generating an ID for your todo items, why don't you simply use a counter ?
 
I am not skilled enough to specify the problem. I showed the code and i told what i want to achieve. I guess its more then enough.
As I understand you want make a to-do list, when you clock the button add you like the itens be append in the main body? To edit you can call a Javascrit prompt, or create tour modal with these fields, cause the <div> content is not editable like <input> or <textarea>
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom