I'm building my first little jquery To Do List, each list item has a checkbox, and when this is checked it is moved to the Done div. This works as expected, it's just that the checkbox is always unchecked. I've experimented with .prop() but it doesn't seem to have any affect.
Here is the HTML:
<div class="form-container">
<h2>To Do</h2>
<form name="checkListForm">
<input class="entry" type="text" name="checkListItem"/>
<div id="button">Add!</div>
</form>
</div>
<div class="list"></div>
<div class="done_name">Done
<div class="done"></div>
</div>
And the JQuery:
$('input[name=checkListContainer]').toggle(
function () {
$(".done_name").show();
$(this).prop("checked", "checked");
$(this).parents('.item_container').appendTo(".done");
},
function () {
$(this).parents('.item_container').appendTo(".list");
$(".done:empty").parent().hide();
});
});