Todo-List (I need my own megathread!) - Creating classes and using DOM

Hey, it's me, your friendly neighbourhood CDL. https://github.com/callum-laing/todo-list As you can see with my current code, when I hit + on Projects, I input text into the field, hit Confirm (tick), and it creates a list item. Now what I am trying to do is turn that list item into a class, a clickable class, and when I click on that list item, it will show me what tasks I have inside the Projects class). I know how to create the 2 classes, I'm just not sure how I then go about combining them with the html/DOM to make it functioning.
class Project {
constructor(name) {
this.name = name;
this.tasks = [];
}

addTask(task) {
this.tasks.push(task);
}
}
class Project {
constructor(name) {
this.name = name;
this.tasks = [];
}

addTask(task) {
this.tasks.push(task);
}
}
class Task {
constructor(name, description, dueDate) {
this.name = name;
this.description = description;
this.dueDate = dueDate;
}
}
class Task {
constructor(name, description, dueDate) {
this.name = name;
this.description = description;
this.dueDate = dueDate;
}
}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server