Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Vic Mercier
3,276 Pointsinsertbefore
Does this method append element because I use it to do:
First I create a span element and appended it.Second I create an input but it wasn't apended.When I've used the insertBefore method,the input is gone before the span but the input wasn't appended?
1 Answer
Steven Parker
243,266 PointsIs this just a matter of terminology?
I'm not quite sure I understand the question, but "append" and "insert" both describe ways of adding something to the DOM tree. An "insert" would place something in front of another, and "append" would add something to the end of another.
You could try expanding your question a bit if that's not it, or perhaps you might find what you need on the MDN Documentation Page for insertBefore.
Vic Mercier
3,276 PointsThat mean insertBefore can append ?
Vic Mercier
3,276 PointsGo watching the video editing state in the dom scripting by example course and you will understand what I mean.
Steven Parker
243,266 PointsPlease provide a link to the video, and an approximate time index, whenever your question is specific to a video.
But I still think this might be a matter of terminology. "Insert" is "put before" and "append" is "put after". But both of them add something new (or change the position of something already there).
Vic Mercier
3,276 PointsVic Mercier
3,276 PointsThank you very much!I don't know what I would do without you!