Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions shoppingApp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//when check button is pressed line goes through item
//remove HTML element when delete is pressed
//add HTML element when add is pressed
//link to jQuery ($())
//link your JS to HTML/CSS page on github
//keyboard friendly (return/tab used when toggle button in place)
//add links to your JS in HTML code (at bottom)

$(function add() {
$("js-shopping-list-form").click(function(event) {
event.addItem();
$(li).append(<li>
<span class="shopping-item">$('shopping-List-Entry'.val(""))</span>
<div class="shopping-item-controls">
<button class="shopping-item-toggle">
<span class="button-label">check</span>
</button>
<button class="shopping-item-delete">
<span class="button-label">delete</span>
</button>
</div>);
)
}
$(add);
}

$(function delete() {
event.deleteItem();
$("shopping-item-delete").click(function(event) {
$(li).not("shopping-item"|$('shopping-List-Entry'.val(""))
)
}
$(delete);
}

$(function check() {
event.checkItem();
$("shopping-item-toggle").click(function(event) {
$(this).css("text-decoration", "line-through");

}
$(check)
}