JSFiddle - React, Tailwind, and code Playground

HTML

<form action="" id="form">
    <input type="text" id="pole1">
    <input type="submit" value="wyślij">
</form>

JavaScript

var form = document.getElementById('form');

form.addEventListener('submit', function(event) {
    event.preventDefault();
    
    var input = 'pole1';
    var value = document.getElementById(input).value;
    localStorage.setItem(input, value);
}, false);