Required radio button does not validate in form, when clicked through Javascript/jQuery

I finally found one that works for me:

document.getElementById("#dealer-selection-" + elm.id).checked=true;

For some reason, this one checks the radio button visually, while also checking it as an option.