Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript jQuery Basics Understanding jQuery Events and DOM Traversal Progressive Enhancement and Unobtrusive JavaScript

What is the correct answer for this question?

Fill in the blank to create a new, empty list item element and add it to the DOM.

$('.my-ul').append('li');

your code block is hard to read ... maybe, if you use markdown and better, you specify the exact question for future questions ... it will be easier for ppl to help you ... the markdown ... if you write: javascript ... before any code, it will appear in "the dark box" and will be easier to read ... because now I cannot see any blanks ... if it is a different language than JS, just always write the threesymbols and specify the language after ... then leave a blank line and then write the code block ... sorry I couldn't answer your question ... but I hope this will held you in general in the future ... regards, Jan.

like:

$('.my-ul').append('li');

the code fences don't show up ... before the language specification ... three: ```

1 Answer

Steven Parker
Steven Parker
231,269 Points

When using a string with "append" (it can also take an element argument), the string should be complete HTML.

So in this case, instead of just the tag name, the string should contain the complete beginning and ending tags just as if you were writing them into the HTML file.

Thank you Steven Parker.

Michael Pashkov
Michael Pashkov
22,024 Points

Hi Steven! I didn`t get. Pls, help.

Bummer! Unfortunately, that answer is incorrect. $('.my-ul').append('<li> </li>');

Steven Parker
Steven Parker
231,269 Points

Try removing the space between the two tags to make it truly "empty".