JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="text" />
<input type="button" id="btn" value="Submit" />
JavaScript
$("#btn").click( function() {
var url = "http://www.mywebsite.com/print/" + $("#text").val();
window.open(url);
});