Длинна пароля<input type="tel" placeholder="" value="" id="passHeight" maxlength="2" onclick="this.select();" required pattern="[0-9]{,3}" style="display: inline-block;"> 

so that when the value changes after a reboot it remains

  • 2
    `localStorage` - use ... Or a database is needed ... Everything depends on the needs and the desired end result - Air
  • one
    can do this either php or js-ohm there is such a thing Kukis - Excess Suslik

1 answer 1

As you said, localStorage. But it only works on the https protocol.

https://codepen.io/anon/pen/VBOzqv

This snippet will not work here, to check the result, go to the codepen link

 document.getElementById("passHeight").value = localStorage.getItem('fieldDeeta'); function handleInput() { localStorage.setItem('fieldDeeta', document.getElementById("passHeight").value); } 
 Длинна пароля<input type="tel" placeholder="" value="" id="passHeight" maxlength="2" onclick="this.select();" required pattern="[0-9]{,3}" style="display: inline-block;" oninput="handleInput()">