Show me when 1st radio checked
Show me when 2nd radio checked
Show me when 3rdd radio checked
When coding with JS and the DOM I find myself constantly needing to generate ids (or names) that have no purpose other than to group DOM elements together (or r
Example of working with radio labels without ID:
Show me when 1st radio checked
Show me when 2nd radio checked
Show me when 3rdd radio checked
JS
$('.button-group[name=sys] :radio').change(function(){
$(this).parent().find('label').removeClass('active');
$(this).next().addClass('active');
/* index radios vs content*/
var radioIndex=$('.button-group[name=sys] :radio').index(this);
/* hide all the content div, show one that matches radio index*/
$('.content div').hide().eq(radioIndex).show();
})