I have a table that, depending on the amount of an X value, it inserts a set of attributes at the end of the page (fields). These elements have events assigned to them. But that's not the point.
Problem is that: since I add the elements after the DOM is loaded (the moment I fill in the value of X), when I close the "Back" button, after any operation, and return to the same screen, the values included in those fields added later do not have their values reloaded and not even the fields themselves.
EDIT
Scenery:
I have a form that generates additional fields, based on other fields already present. These fields vary in size, so I can not include them with "display: none" and simply show them later.
Then my user fills out the form, generates the additional fields and "Save" button, but the form does not pass validation.
In this case I could (should) redirect the user to the previous screen. This is where the problem arises: As additional fields were generated after the DOM was loaded and rendered, they did not appear when the user returned to the screen because the browser takes this information from DOM *.
I imagine there must be another way to do this, but that was just to give an example. I really need to add elements to the DOM later.
Does anyone know if it's possible to add these elements to the DOM even after it loads?
* This information it loads from the DOM I got from "untrusted" sources by comments on a blog.