Suppose I have a form
<form>
<input name="username"/>
</form>
Now when the user enters the username, the second time the user comes to the page again, the username has been obtained from the server. How can the input on the page display the username that the user has entered
Two solutions
Backend: Get the data from the backend and assign it to the input
Frontend: Save the input value to local cookie or localStorage
The first one
Server
Template
Second type
Refer to the comment function of this blog website. After the user enters the user name and email address for the first time comment, localstorage caches it. Next time, the cache is directly read and assigned to the value of the form
https://blog.codefun.cn/blog/...
Aren’t your inputs stored in the background data? Page loading request data.