Append to Body


#1


https://www.codecademy.com/en/courses/web-beginner-en-v6phg/2/3?curriculum_id=50a3fad8c7a770b5fd0007a1


I'm unable to click the button and add any items.(Although I passed the lesson)


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


#2

this line:

var toAdd=('input[name=checklistItem]').val();

jquery selectors are always $('elementName'), the $ is missing in your case

List of checkListItem should be with uppercase L


#3

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