JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="q" />
<input type="button" id="submit" value="submit" />
JavaScript
$(document).keypress(function(e) {
if(e.which == 13) {
var url = "/tag/";
url += $('#q').val();
window.location = url;
}
});