Return to Snippet

Revision: 16482
at August 6, 2009 04:54 by ping_ch


Initial Code
$(document).ready(function(){
    updateRadioLabels()
    $('input[type=radio]').change(updateRadioLabels)
})

function updateRadioLabels(){
    
    $('input[type=radio]').each(function(){
        $('input[name=' + this.name +'] + label').removeClass('selected');
        $('input[name=' + this.name +']:checked + label').addClass('selected');    
    })
    
}

Initial URL
add_css_class_to_selected_radio_labels

Initial Description


Initial Title
Add css class to selected radio labels

Initial Tags
html, jquery

Initial Language
jQuery