# Problem with a To Do List

**URL:** <https://forum.freecodecamp.org/t/problem-with-a-to-do-list/152100>\
**Category:** General\
**Created:** [October 8, 2017, 5:34pm UTC](https://forum.freecodecamp.org/t/problem-with-a-to-do-list/152100 "2017-10-08T17:34:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![syonrod](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/syonrod/32/66126_2.png) [@syonrod](https://forum.freecodecamp.org/u/syonrod)\
**Post date:** [October 8, 2017, 5:34pm UTC](https://forum.freecodecamp.org/t/problem-with-a-to-do-list/152100/1 "2017-10-08T17:34:18Z")

</div>

Hey guys i need help, i’m building a to-do list and i’m having problems at the moment that u want to add a new task after the first one. If u have time to check please give me some help there.  
Thanks  
[https://codepen.io/syonrod/pen/BwYgLr](https://codepen.io/syonrod/pen/BwYgLr)

---

<div class="post-metadata">

**Author:** ![sfiquet](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sfiquet/32/67130_2.png) [@sfiquet](https://forum.freecodecamp.org/u/sfiquet)\
**Post date:** [October 8, 2017, 6:50pm UTC](https://forum.freecodecamp.org/t/problem-with-a-to-do-list/152100/2 "2017-10-08T18:50:54Z")

</div>

The first problem is that you only create the text nodes “-” and “o” once. When we add a new item, those text nodes are set as children of the new buttons with the lines `remove.appendChild(removeItem);` and `complete.appendChild(completeItem);`. Since they can’t simultaneously be children of the other buttons, the previous list items lose their text. Or at least that’s how I understand it, I’m not 100% sure of my explanation. In any case you can see the effect if you look at the actual HTML on the page with the developer tools (you have to dig a little bit in CodePen’s HTML to get to the right point).

You will need to create the text nodes for each item in the list. Now when you do that, the styling still looks wrong. I haven’t looked very deep but it might have to do with the styling only being applied to the ::last-of-type pseudo-element.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:38pm UTC](https://forum.freecodecamp.org/t/problem-with-a-to-do-list/152100/3 "2021-01-17T20:38:00Z")

</div>

Closed on January 17, 2021, 8:38pm UTC


