JSFiddle - React, Tailwind, and code Playground

HTML

<body>
<form>
    Password: <input type="password" name="password"  onchange="password2.pattern=(this.value);">
    <br/>
    Retype Password: <input type="password" name="password2" pattern="" title="Retype Password">
    <input type="submit">
</form>
</body>