JSFiddle - React, Tailwind, and code Playground

HTML

<input type="password" id="new_pass" value="" placeholder="New" />
<label class="pw_show">
    <input type="checkbox" />Show Password</label>

JavaScript

var pwi = $('#new_pass');

$('.pw_show').find("input").on('change', function () {
    pwi.prop("type", (this.checked) ? "text" : "password");

});