JSFiddle - React, Tailwind, and code Playground
HTML
Type your word into the box:
<br>
<input type="text" id="word">
<span id="preview"></span>
JavaScript
document.getElementById("word").addEventListener("keyup", function() {
document.getElementById("preview").innerHTML = this.value.replace(/(\w+[aeiou]+).*/i, "$1xy");
}, false);