Ashot Tarumyan Ashot Tarumyan - 18 days ago 6
Javascript Question

How to make html <input> tag with pre-written data

I'm working on a project, and for testing it I need to fill in a large amount of 'input' elements every time when reloading the page. I'm filling in the same numbers every time, so I need 'input' elements to somehow 'remember' the value they were given.
I've seen an example with 'autocomplete' attribute, but then I have to choose the value from a drop box for each input element, so that won't help me.

Is there any way I can code the input tag with pre-written data? Or maybe using javascript?

Answer

here the unput value

<form >
  First name: <input type="text" name="fname" value="John"><br>
  Last name: <input type="text" name="lname" value="Doe"><br>

</form>