Removing items from a to do list using Javascript

前端 未结 3 876
一整个雨季
一整个雨季 2021-01-07 07:31

Attempting my first Javascript project, playing around with DOM to make a To-Do List. After adding an item, how do i get the \'Remove\' button to function and remove the ite

3条回答
  •  执笔经年
    2021-01-07 08:00

    You can simply assign event:

     removeTask.addEventListener('click', function(e) {
            node.parentNode.removeChild(node);
        });
    

    http://jsfiddle.net/g79ssyqv/6/

提交回复
热议问题