Remove What's Been Clicked


See error message in attached screenshot.
What makes me confused:
1. It throws error, even though I can go to next lesson;
2. Does the event must be in quotation marks. In our case -> would that be correct if I used '.click()' instead of .click().
And why is so?

        var toAdd = $('input[name=checkListItem]').val();
        $('.list').append('<div class="item">' + toAdd + '</div>');
    $(document).on(.click(), '.item', function(){


The lesson validation is not always perfect

on line 2, .click() is a function call which triggers something.

on line 6, "click" is an argument of the .on() function call. .on() expects the event it is suppose to handle to be a string.

So .click() is a function call, where as "click" is an argument for the .on() function call

jquery - on
jquery - click


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