13. Remove What's Been Clicked - Using a 2nd $(document)



Hey I'm just revisiting this exercise and I'm curious about why I have an $(document) inside of another.The code below passes the exercise, but is there better syntax for using .on()? Why is the document the selector twice in a row? Is this exercise meant to be done a different way?

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


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