SO - 19141911

by Dedi Wibisono

HTML

<button id="toggler">click me</button><br>
<input type="radio" name="speeds" value="fast" checked>fast<br>
<input type="radio" name="speeds" value="medium">medium<br>
<input type="radio" name="speeds" value="slow">slow<br>

JavaScript

var $radios = $('input[type="radio"][name="speeds"]')
    var $checked = $radios.filter(':checked');
    var $next = $radios.eq($radios.index($checked) + 1);
    if(!$next.length){
        $next = $radios.first();
    }
    $next.prop("checked", true);