This version is old school.
Please find jQuery plugins on npm.
jQuery keepFormData
jQuery-keepFormData allows you to restore the values of the form's fields, the state of checkboxes, radio buttons and select elements that the user entered, after reloading the page. By default, values are stored until form's submit.