How to access HTML input values from Twig and vice versa
You can do it without JavaScript (if you don't mind the page refreshing) by accessing the request variable:

https://docs.craftcms.com/api/v3/craft-web-twig-variables-request.html#public-methods

{{ craft.app.request.getParam('foo') }} {# Should be the value of the input named 'foo' #}