12.Append to Body (Some help please)


#1



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


I'm stuck in this lesson for about 1 to 2 days and I can't figure out what I'm doing wrong. Can someone help me or at least point me to another topic which can provide me some help. (The last ERROR message it gives me is the one below and I have changed the "<>" so "div" can be displayed.)

"Oops, try again. It looks like you didn't append() a new >div< to your .list."


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


#4

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

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

#5

@michaelangel1234

Try again :stuck_out_tongue:


#6

It looks ok to my submission.


#7

Oh it worked thanks ! What I was doing wrong was that I was putting double quotes in the opening and in class i putted single quotation.
Still can't find the difference but it's ok.


#8

:joy: That's my first mistake too.


#9

Well ok thanks a lot again!


#10

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