13 of 14 Remove What's Been Clicked


#1

Hi,
When I click Save & Submit, it goes thru' but I see the syntax error. I looked thru' diligently, can't see the syntax error.
Thanks in advance!
Sue

$(document).ready(function() {
$('#button').click(function() {
var toAdd = $('input[name=checkListItem]').val();

 $('.list').append('<div class="item">' + toAdd + '</div>');

});

$(document).on('click', '.item',.remove() {
});
});


#2

here

$(document).on('click', '.item',.remove() {
});

you syntax should be like

$(document).on('event', 'selector', function() {
    Do something!
});

so you need a handler to do something. your .remove() method should be inside function.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.