Posted By

ping_ch on 08/06/09


Tagged

html jquery radio labels radiobutton


Versions (?)


Advertising

Submit Site


Add css class to selected radio labels


Published in: jQuery 



Website Promotion
DIRECTORY
is a crucial factor for all websites that need to gain better organic search engine rankings and increase website traffic.
Submitting your website as part of your Web Promotion strategy to our SEO friendly and high traffic Business Directory for review is an excellent way to gain a valuable backlink and increase your websites visibility online.

Submit Site


URL: add_css_class_to_selected_radio_labels

Expand | Embed | Plain Text
  1. $(document).ready(function(){
  2. updateRadioLabels()
  3. $('input[type=radio]').change(updateRadioLabels)
  4. })
  5.  
  6. function updateRadioLabels(){
  7.  
  8. $('input[type=radio]').each(function(){
  9. $('input[name=' + this.name +'] + label').removeClass('selected');
  10. $('input[name=' + this.name +']:checked + label').addClass('selected');
  11. })
  12.  
  13. }

Report this snippet 

You need to login to post a comment.

Download royalty free graphics