I created a to do list and have it set to add the item when you click the add button but I want to make it to where you can press enter and here is my code:
function addListItem() {
var text = $("#new-text").val();
$("#todolist").append('<li><input type="checkbox" class="done"/>'+text+'<button class="delete">Delete</button></li>');
$("#new-text").val('');
}
$(function() {
$("#add").on('keypress' , addListItem);
}
please help