Posted By


vbchrisw on 11/23/10

Tagged


Statistics


Viewed 68 times
Favorited by 0 user(s)

Checkbox/RadioButton


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var bFlag = $('#test2').is(':checked');
  2.  
  3. // To get the currently selected radio button's id
  4. var id = $("input[@name=testGroup]:checked").attr('id');
  5.  
  6. // Input has a unique 'value' attribute:
  7. var value = $("input[@name=testGroup]:checked").val();
  8.  
  9. // Check the checkbox
  10. $("input").attr("checked", "checked");
  11.  
  12. // Radiobutton value
  13. $('.columns input:radio:checked').val()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.