JSFiddle - React, Tailwind, and code Playground
HTML
<form action="#">Billing Address same as Shipping Address:
<input type="checkbox" name="billingAddress" id="billingAddress" />
<br />
<br />Street Address:
<input class="baddr" type="text" name="street" id="street" />
<br />
<br />City:
<input class="baddr" type="text" name="city" id="city" />
</form>
JavaScript
$(document).ready(function () {
$("#billingAddress").click(function () {
if ($(this).prop("checked")) {
alert("Id billingAddress is checked!");
$(".baddr").val("").prop('disabled', 'disabled');;
} else if ($(this).prop("checked") == undefined) {
$(".baddr").removeAttr("disabled");
}
});
});