Hide a field depending on radio buttons

I'm sure I've done this before some years ago but can't get it working in v2026.

I have a radio field with 2 options which are text values and want to hide another field depending on which button was selected.

I tried...

$(#x_roleEmailType).change(function() {
if($(this).val() == "Forwarder")
{
$("#x_forwarderDestination").visible(false);
}
else
{
$("#x_forwarderDestination").visible(true);
}
});

... but no response.

Any idea what I'm doing wrong?

Should be $("#x_roleEmailType").

Thanks but still not seeing anything even in the console log using...

$("#x_roleEmailType").change(function() {
    console.log($(this).val());
.....

You better check the element in your browser and see if there is an element with id "x_roleEmailType" (case-sensitive). If yes, check what the element is, if it is a "selection-list", then you better use vanilla JavaScript, e.g.

document.getElementById("x_roleEmailType").addEventListener('change', () => {
  // Your code
});