c a n d l a n d . n e t

Get the selected radio button value using prototype

Dusty Candland | |

Assuming you have a set of radio buttons with the same id, you can use the following to get the value of the selected/checked button.

var value = null;
$$(‘#plan_plan’).each( function(i) {

<span class="kwrd">if</span> ($F(i)) { value = $F(i); }

} );

Webmentions

These are webmentions via the IndieWeb and webmention.io. Mention this post from your site: