From the course: JavaScript: Enhancing the DOM

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Solution: Adding a feature

Solution: Adding a feature

(upbeat music) - [Instructor] As you can see it's working now. I can go ahead and add skills and then delete them as well, and also, it's no longer showing up on the experience and contact page. Here's why it's no longer showing up. Remember in the show section we were hiding all the sections. That's where you had the skills as well. My line 12 is grabbing the skills class list and removing the active class. The other thing I did, I implemented the skills.js. When the DOM content is loaded, I load all the skills and I also add the event handler to the form so that when it's submitted, it actually gets added. So let's have a quick look at load. So I'm doing a fetch to API skills, and then in there I'm grabbing the skills list, setting the innerHTML to clear. Otherwise, just going to append it every time again, and it gets really lengthy. Next, I'm creating some elements, for every skill I'm creating a list item, setting the skill to be the text content, but I'm also creating a button…

Contents