Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript and the DOM Making Changes to the DOM Append Nodes

karan Badhwar
seal-mask
.a{fill-rule:evenodd;}techdegree
karan Badhwar
Web Development Techdegree Student 13,000 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
216,175 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.