JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" id="address-same" checked="checked" />

JavaScript

$("#address-same").on('click',function() {
    
    if (this.checked) {
        //$(this).removeAttr("checked");
        alert("checked");
    }else {
        //$(this).attr("checked","checked");
        alert("nochecked");
    }
});