diff --git a/detail.html b/detail.html index 160571b..04170d8 100644 --- a/detail.html +++ b/detail.html @@ -9,7 +9,7 @@

TODO LIST

- +
- + +
- + diff --git a/simple.js b/simple.js new file mode 100644 index 0000000..b6a237b --- /dev/null +++ b/simple.js @@ -0,0 +1,17 @@ +const list = document.getElementById('todo-list'); +const submitBtn = document.getElementById('submit-btn'); +submitBtn.addEventListener('click', appendList); + +function appendList() { + const item = document.getElementById('item'); + if (confirm(item.value + ' 저장하시겠습니까?') != true) { + item.value = null; + return; + } + + const node = document.createElement('li'); + const textnode = document.createTextNode(item.value); + node.appendChild(textnode); + list.appendChild(node); + item.value = null; +} \ No newline at end of file