Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Todo App with HTML, CSS & JS

Dugidem 160

@DeeNue36

Desktop design screenshot for the Todo app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


What specific areas of your project would you like help with?

I built this a long time ago and I'm currently working on new projects so any help with not allowing the add todo button to add an empty todo would be welcome

Community feedback

P

@Risclover

Posted

You could do something like this. It basically takes the trimmed (trimmed meaning spaces are ignored) input value's length. The length being 0 means that the input box is empty, so if it isn't 0, allow the todoDiv element to be appended to the list element.

if (todoInputs.value.trim().length !== 0) {
    list.appendChild(todoDiv);
}

If you have any further questions or if I misunderstood your original question, feel free to let me know!

Marked as helpful

2

Dugidem 160

@DeeNue36

Posted

@Risclover Thank you. Will give this a try immediately and let you know how that turns out

0
Dugidem 160

@DeeNue36

Posted

@Risclover Works like magic. Thank you so much.

0
P

@Risclover

Posted

@DeeNue36 I'm very late with this response, but yay! I'm glad it worked out. No problem.

1
Rahmonbek 260

@Rahmonbek-0001

Posted

you have to work a lot with this code

0

Dugidem 160

@DeeNue36

Posted

@Rahmonbek-0001 I don't understand. Do you mean I have a lot to work on with this code? If that's the case, like I mentioned, it's a really old project, about three years now when I started programming full time. I forgot to submit it and a couple of other challenges

1
Rahmonbek 260

@Rahmonbek-0001

Posted

@DeeNue36 sorry i didn't know that

0
Dugidem 160

@DeeNue36

Posted

@Rahmonbek-0001 It's alright, criticism is welcome. Will definitely retry the challenge should time permit.

0
P

@Risclover

Posted

@Rahmonbek-0001 I know you guys already resolved this, but I wanted to add that I think it would be a lot more constructive if, in the future, you gave the person specific examples instead of just simply telling them that their code needs work. :)

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord