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

JavaScript JavaScript and the DOM Making Changes to the DOM Insert HTML at Specified Positions

Malachi Gruenhagen
Malachi Gruenhagen
3,226 Points

FYI, these DOM manipulation tutorials should probably include some discussion of code injection attacks.

FYI, these DOM manipulation tutorials should probably include some discussion of code injection attacks.

1 Answer

Steven Parker
Steven Parker
231,275 Points

I noticed the example only safely inserts user-supplied values to textContent, but a quick mention that user values should never be inserted as code wouldn't be amiss.

There are, however, separate security courses that should be part of every aspiring developer's curriculum.

Wow, okay, you've both given me a bit to think about here! Malachi Gruenhagen - nice pickup in your review of the video, and Steven Parker, as always you've been an invaluable asset to the community! I'll think about a meaningful comment to add to the Teacher's Notes for this video, and suggest that students look further into the course material that Steven has suggested! :-D

Edit: Done!