JSFiddle - React, Tailwind, and code Playground
HTML
<form id="form">
<input type="text" placeholder="Search Google" id="input" />
</form>
JavaScript
const $form = document.getElementById('form')
const $input = document.getElementById('input')
$form.addEventListener('submit', (evt) => {
evt.preventDefault()
window.open(`https://google.com/search?q=${$input.value}`)
})