-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
28 lines (22 loc) · 837 Bytes
/
script.js
File metadata and controls
28 lines (22 loc) · 837 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
$(document).ready(function() {
$("ul").sortable();
$('.button').click(function() {
var x = document.getElementById("thing");
var a = x.value.replace(/\s/g, '');
if (a === "") {
x.value = "";
} else {
var toAdd = $("input[name=checkListItem]").val();
$(".todo-list").prepend('<li class="item" draggable="true" ondragstart="drag(event)" id="drag4">' + toAdd + '<div class="signc"><div class="signcc">\u00D7</div></div>' + '</li>');
x.value = "";
}
});
$(document).on('click', '.signc', function() {
$(this).parent().fadeOut('fast', function() {
$(this).remove();
});
});
$(document).on('click', '.item', function() {
$(this).toggleClass("linet");
});
});