-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjquery.js
More file actions
24 lines (22 loc) · 724 Bytes
/
jquery.js
File metadata and controls
24 lines (22 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$(document).ready(function() {
// Add task functionality
$('#add-task').on('click', function(event) {
event.preventDefault();
var newTask = $('#new-task').val();
if (newTask !== '') {
var $newListItem = $('<li>').text(newTask);
$newListItem.css({
'background-color': 'rgb(201, 175, 236)',
'margin': '5px',
'padding': '5px',
'border-radius': '20px',
'font-size': '20px'
});
$newListItem.appendTo('.container');
$('#new-task').val('');
}
});
$(document).on('click', '.container li', function() {
$(this).remove();
});
})