From the course: jQuery: Building an Interface

Unlock the full course today

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

Editing data

Editing data - jQuery Tutorial

From the course: jQuery: Building an Interface

Start my 1-month free trial

Editing data

- [Instructor] So, it's time to make our content editable. Now, I could create some sort of button that maybe pulls up this form once you click on it and allows you to sort of edit everything in this form, but I think it's easier to use a feature of HTML called ContentEditable. When you create an HTML element, you can ask it to have the ContentEditable attribute, and what that does is allow you to edit any of the content. So right now, this name, the owner, and this text right here for the appointment info are all under that ContentEditable attribute. So we can go ahead and modify something. So let's go ahead and we'll change this to Sniggles. And you can see that it changes the text in the DOM. Now, that doesn't modify the data at all. All it does is change the DOM. So if I resort this by ascending, and then I'll resort it by descending, you can see that it resets it back to the original. So, what we can do is create some code that will actually update the data and the…

Contents