Skip to content

Commit 166c6e8

Browse files
committed
Write a JavaScript script that adds, removes and clears LI elements from a list when the user clicks
1 parent c18b4d6 commit 166c6e8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
$('document').ready(function () {
2+
$('DIV#add_item').click(function () {
3+
$('UL.my_list').append('<li>Item</li>');
4+
});
5+
$('DIV#remove_item').click(function () {
6+
$('UL.my_list li:last').remove();
7+
});
8+
$('DIV#clear_list').click(function () {
9+
$('UL.my_list').empty();
10+
});
11+
});

0 commit comments

Comments
 (0)