Checkbox issue

I am migrating the following code from php maker 2018 to 2023 . The checkbox id is changing dynamically and it is not working, how do i solve this.

$("#x_SIMULATION_AND_OTHER_REQ\\[\\]_0").click(function() {
    		if ($(this).prop('checked') !== false) {
    			$("#thermaldt_id").show();
    		}
    		else {
    			$("#thermaldt_id").hide();
    			$("#x_THERMAL_DATE").val("");
    			$('#el_mdd_requests_THERMAL_DATE').removeClass('has-error');
    		}
    	})
    	$("#x_SIMULATION_AND_OTHER_REQ\\[\\]_1").click(function() {
    		if ($(this).prop('checked') !== false) {
    			$("#structuraldt_id").show();
    		}
    		else {
    			$("#structuraldt_id").hide();
    			$("#x_STRUCTURAL_DATE").val("");
    			$('#el_mdd_requests_STRUCTURAL_DATE').removeClass('has-error');
    		}
    	});
    	$("#x_SIMULATION_AND_OTHER_REQ\\[\\]_2").click(function() {
    		if ($(this).prop('checked') !== false) {
    			$("#cablingdt_id").show();
    		}
    		else {
    			$("#cablingdt_id").hide();
    			$("#x_CABLING_DATE").val("");
    			$('#el_mdd_requests_CABLING_DATE').removeClass('has-error');
    		}
    	});

Similar to: https://discourse.hkvstore.com/t/radio-button-client-side-event/8821/1