JSFiddle - React, Tailwind, and code Playground

HTML

<input type="password" id="Password" tabindex="2" class="nice-textbox">
<input id="PasswordChk" type="checkbox" disabled="disabled"/>

JavaScript

$('#Password').on("keyup", function () {
    var password = $.trim($(this).val());    
    if(password.length == 0){
        $('#PasswordChk').removeAttr("checked");
    }else{
        $('#PasswordChk').attr("checked", "checked");
    }    
});