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.
The multiple line string with tilde doest not work for me
For some reason, this does not work for as it is quite annoying since this is pretty straight forward. I have either pressed the incorrect tilde ` or there something with the browser which is Chrome version 71.0.3578.98. Lastly, it can be something with the code I am missing up with, without noticing it.
The HTML of both lists does not show up on the page. But the fruitList do when loaded alone.
const fruitList = "<ul>" + "<li>Kiwi</li>" + "<li>Lime</li>" + "<li>Pineapple</li>" + "</ul>"; const vegetableList = ` <ul> <li>Potato</li> <li>Onion</li> <li>Broccoli</li> </ul> `; document.querySelector('.fruits').innerHTML = fruitList; document.querySelector('.vegetables').innerHTML = vegetableList;
Steven Parker216,083 Points
This code seems fine in itself, but needs HTML to go with it to work. I tested it using this HTML:
<div class="fruits"></div> <div class="vegetables"></div>
Both lists displayed as expected. What does the actual HTML look like?