Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
217,602 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
217,602 Points

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