Get check radio button value with js

I am having a brain f@rt, or maybe a code related pre-senior moment.

I thought a radio button set had a js property, similar to selectedIndex of a dropdown list that would allow you to easily retrieve the value of a checked button.

I know how to do this in jQuery via “:button :checked”, or in js with a foreach loop to iterate through the button elements an attaching an event listener to each one. Which is fine it just seems convoluted if there was already a native way of doing this. Have I really forgotten something or am I just dreaming?

I don’t think that you’ve forgotten anything. It could be a useful scripting behaviour to have, but there doesn’t seem to be anything built in that lets you retrieve the value of the currently selected radio button.

Thanks Paul_W. My neurons must have been tangled.