js question
https://codepen.io/etrbbr/pen/LEPoMQZ
Hey guys. When I add a new <li> element, an <hr> line should appear after each one. But the problem is that when I add it via JS, it works incorrectly.
How it should look – in CodePen before adding new elements.

7 Replies
And another problem: when I write a lot of text, like rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr, it doesn't wrap. But if I add even a single space, everything works fine. What's the problem?
to fix the latter you can use
word-break
or overflow-wrap
there is nothing in your js that adds the hr elementyes i think because i didnt add hr in codepen. i was adding my hr after <li> here
that was the problem
but can you check codepen again, i am doing smth wrong when aiam adding hr
https://codepen.io/etrbbr/pen/LEPoMQZ

i would move the creation of the hr element to the updateToDoList() and use after not append
I don't believe that <hr> is not a valid child element of a ul. If you need lines after each "todo" item it would be simplest to add a bottom border via CSS.
i didn't think of that and yeah border seems far easier way
hell.. i didnt think about that also
thanks guys 😄