forked from projectlumos/testone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
32 lines (24 loc) · 803 Bytes
/
main.js
File metadata and controls
32 lines (24 loc) · 803 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
25
26
27
28
29
30
function addItem() {
var text = $("#input").val();
$("#todo").append('<li><input type="checkbox" class="strike" />' +text+ ' <button class="delete btn btn-warning"><i class="fa fa-trash-o"> </i> Delete </button> </li>');
$("#input").val('');
}
function deleteItem() {
$(this).parent().remove();
}
function strikeOut() {
if ($(this).parent().css('textDecoration') == 'line-through') {
$(this).parent().css('textDecoration','none');
}
else {
$(this).parent().css('textDecoration','line-through');
}
}
$(function() {
$("#add").on('click',addItem);
$(document).on('click','.delete',deleteItem);
$(document).on('click', '.strike', strikeOut);
});
function viewList1() {
document.getElementById("list1").style.display="block";
}