I have 3 options for an onchange event to open and hide radio button values. I am not sure how I can set the first one (value == 2) to already be opened on the page by default. Any help with this would be greatly appreciated. Below is the code I currently have.
$('input[name="type"]').on('change', function () {
$('.opening-fields').toggle(+this.value === 1 && this.checked);
$('.qualify-fields').toggle(+this.value === 2 && this.checked);
$('.verify-fields').toggle(+this.value === 3 && this.checked);
$('.datasheet-fields').toggle(+this.value === 4 && this.checked);
}).change();
checkedattribute on the relevantinput.