JSFiddle - React, Tailwind, and code Playground
HTML
<label><input name="testing" type="radio" value="hi" />Hi</label>
<label><input name="testing" type="radio" value="ho" />Ho</label>
<div id="debug"></div>
<label><input name="maritalstatus" type="radio" value="0" />Hi</label>
<label><input name="maritalstatus" type="radio" value="1" />Ho</label>
JavaScript
$("body").on("change", ":input[name=testing]", function () {
$("#debug").append($("<div/>").text("in change handler for " + $(this).attr("type") + " " + $(this).attr("value")));
});
$(":input[value=hi]").click();
$("input:radio[name=scustomer[maritalstatus]]").change(function(){
var id = $(this).val();
if (id==="1"){
$("#debug").append($("<div/>").text("in change handler for " + $(this).attr("type") + " " + $(this).attr("value")));
}
else{
$("#debug").append($("<div/>").text("in married handler for " + $(this).attr("type") + " " + $(this).attr("value")));
}
});