@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
@DeeNue36
Posted
@Risclover Thank you. Will give this a try immediately and let you know how that turns out
@DeeNue36
Posted
@Risclover Works like magic. Thank you so much.
@Risclover
Posted
@DeeNue36 I'm very late with this response, but yay! I'm glad it worked out. No problem.