Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
We can use properties to select elements based on their relationships with other elements. Here we'll select all the children of an element with the children property.
Code Snippet
btnCreate.addEventListener('click', () => {
let ul = document.getElementsByTagName('ul')[0];
const input = document.querySelector('.input-main');
let li = document.createElement('li');
li.textContent = input.value;
ul.appendChild(li);
input.value = '';
});
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Jamie Konrad
2,301 PointsI Copied the code from the Video yet the buttons dont show up, what am I doing wrong?
Posted by Jamie KonradJamie Konrad
2,301 Points1 Answer
-
Gal Parselany
Full Stack JavaScript Techdegree Graduate 26,281 Points1 Answer
-
Samuel Kleos
Front End Web Development Techdegree Student 13,728 Points1 Answer
-
Samuel Kleos
Front End Web Development Techdegree Student 13,728 Points1 Answer
-
PLUS
Stephen Cole
Courses Plus Student 15,810 Points1 Answer
-
Alexis Hay
Front End Web Development Techdegree Student 8,693 Points5 Answers
-
Keith McGill
Full Stack JavaScript Techdegree Student 6,852 Points2 Answers
-
Victor Reynaga
5,054 Points0 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up