Posted By

vbchrisw on 11/23/10


Tagged

input


Versions (?)

Checkbox/RadioButton


 / Published in: jQuery
 

  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  

You need to login to post a comment.