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 Append Nodes

karan Badhwar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
karan Badhwar
Web Development Techdegree Graduate 18,135 Points

Added Content

The Inputted content via User Interaction and added to the DOM via JavaScript, Why the data disappears on every time I refresh the page. It does not get store to the HTML File permanently ?

1 Answer

Steven Parker
Steven Parker
231,275 Points

The HTML file comes from the server, but the DOM only exists inside your browser (where the JavaScript program is also running).

For any effects of user interaction to be permanent, the page would need to send data back to the server (typically done with a form) and then code running in the server would need to react to the incoming data and modify files and/or databases.

This is a much more advanced process covered in later courses.