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
Igor Pavlenko
12,925 Pointswhy i do not get value of the input ?
why i do not get the value back. I receive an empty string back ?
const descriptionChanger = document.getElementById('description'); const addItemInput = document.querySelector('input.additeminput'); const addItemButton = document.querySelector('button#additembutton'); const listOfProducts = document.querySelectorAll('ul')[0];
descriptionChanger.addEventListener('click', () => {
alert(addItemInput.value);
listOfProducts.innerHTML = <ul>
<li>${addItemInput.value}</li>
<li>apple</li>
<li>apple</li>
</ul>;
});
1 Answer
Steven Parker
243,318 PointsIt looks like you might have an issue with your template string but it's not clear in the unformatted code. It would also be helpful to see the HTML part of the code.
Use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area.
Or watch this video on code formatting.
Even better, make a snapshot of your workspace and post the link to it here.
Igor Pavlenko
12,925 PointsIgor Pavlenko
12,925 Pointslooks like it, Thnx !!