Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed DOM Scripting By Example!
You have completed DOM Scripting By Example!
Preview
In the previous video, we added an 'edit' button to our list items. Now we'll need to manipulate the DOM when the 'edit' buttons are clicked to get to an editing state.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
to get to an editing state.
0:00
So how will we need to manipulate
the DOM to move to an editing state?
0:02
We want the text to turn into a text input
element so the user can alter the text.
0:06
So let's start there.
0:11
So we're gonna need to create a text input
and replace the current text with it.
0:12
That means we'll also need to remove
the text from the list item so
0:17
we can put this new element in its place.
0:21
So let's hop over to Chrome Dev Tools to
look at the list items DOM structure.
0:24
Now if you don't have a list
item generated go ahead and
0:27
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