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
How to save elements added to the DOM?
Steven Parker229,017 Points
If you wanted to make permanent changes to the HTML file, you'd need to send the info back to the server (sometimes called a "postback" operation), and the server program would need to receive that update and apply it to the HTML file directly.
In the browser, you could write it into the local storage, and each time the page is re-loaded your script could add it back to the DOM.
If your website supports a forum, you have other mechanisms where information in a database is used to construct pages on demand, and that process could be used for this as well.