From the course: jQuery for Web Designers

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Modify the DOM

Modify the DOM - jQuery Tutorial

From the course: jQuery for Web Designers

Start my 1-month free trial

Modify the DOM

- [Voiceover] In this video, we are going to look at adding elements too, and removing elements from the active DOM, using jQuery. This feature is much easier to work with in jQuery than in vanilla JavaScript, and you will see it often. The example we are working with is possibly the greatest web app of all time, the Friends and Pets tracker. You probably have seen this in web forms, where you have a few initial fields, and then you want to add more when there is more input needed. Of course, somebody, hopefully, would have more than one friend they would want to put in their friends tracker, and possibly more than a couple of pets. Usually, there would be a button here, or some other way of triggering, "I want to add more fields now, please." In our case, just for demonstration purposes, we are going to do everything when the page first loads. Here's my HTML file. I'm going to scroll down a little bit, and you can see my form. I have a group called group friends, and another group…

Contents