12. Append to Body - Completely stuck!


#1

Can someone please help me with this, completely stuck here!

here is my code:

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

#2

@netjumper53914,
Have a read, about the SYNTAX
of the jQuery Selector by attribute equals
https://api.jquery.com/attribute-equals-selector/


#3

This one really is a tricky one, but you'll need to target your .list item to function the variable you made earlyer.

to do so you'll have to type:

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

hopes this helps :slightly_smiling:


#4

@dutton102,
Please re-edit your Post

  • leave one blank-line above of your code
  • select your code in the Post
  • then =click= on the </>-symbol-of-this-editor

Your code will then be in a pre-code state
and you will be able to make/present the proper indentations.

or even better use
= http://discuss.codecademy.com/t/using-backticks-to-format-your-code/3697/2
[extra's]
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet


#7