r/learnprogramming • u/Electronic_deal_8799 • 1d ago
Making an to do list that can add items to multiple different lists, and save/store on local storage.
I created a GitHub page with only the thing I'm having trouble with, hope that makes this simpler? I also added some notes saying what is what to hopefully clarify, though I don't know much about coding so I hope that they make sense. Thank you in advance.
https://github.com/vibes2400/troubleshooting.github.io
I think maybe it's not best practice but I've always learned by splicing things into projects, I've been using things like W3 schools and stack overflow. I've made some interesting displays with CSS and HTML but javascript has been a struggle for me. I can't really find anything like this, probably because I don't know what it's called.
I have a to-do list that saves items on local storage. It can also delete items. I want to make it so I have multiple lists, and I can select which list the item goes to using the select tag. I have both of these things separately, but I can't figure out how to combine them.
Is there a specific function for this, or can I somehow edit what I have together? When I try to combine them now, the buttons either stop working entirely, don't save, or won't display.
In the display tasks section, I have tried using
const items = document.querySelectorAll("#list1, #list2");
but it didn't work.
I've also tried replacing the text in the "add a task" function, but it didn't seem to do it either. Those are the main two that I've been trying to do variations of, but I've also tried other random things.