I am currently working on a project where I need to be able to handle storing and viewing HTML strings (from a database, but from the page itself for testing) which have input elements in them. I also need to store the current input values (what the user has placed in them while the user is viewing the page) of the elements, preferably within the HTML string.
Here is an example of what I looking for help with:
I have the following HTML displaying:
<p id="pullfrom">
Character Name: <input><br>
Character Level: <input type="number">
</p>
<button onclick="algorithm('pullfrom')">Save</button>
The user then enters a character name of "Garrus Vakarian" into the text box and "5" into the number box. Then the user presses the save button which calls the algorithm.
The algorithm then returns:
<p id="pullfrom">
Character Name: <input value="Garrus Vakarian"><br>
Character Level: <input type="number" value="5">
</p>