We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7de3e29 commit f63d033Copy full SHA for f63d033
dom-manipulation/todo-jquery/script.js
@@ -2,6 +2,20 @@
2
$('#addtask').click(function() {
3
$('#tasklist').append(
4
5
- $('<li>').text($('#newtask').val())
+ $('<li>')
6
+ .append(
7
+ $('<button>')
8
+ .text('❌')
9
+ .click(function (ev) {
10
+ // ev -> the event
11
+ // ev.target -> the element on which click happened
12
+ // parent() -> the li element
13
+ $(ev.target).parent().remove()
14
+ })
15
+ )
16
+ .append($('<span>').text($('#newtask').val()))
17
)
18
+
19
+ $('#newtask').val('')
20
21
})
0 commit comments