Advertisement
shaashwato1308

jQuery - Radio, Checkbox get value

Jul 20th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.68 KB | None | 0 0
  1. // radio button
  2. $('input[name=name_of_your_radiobutton]:checked').val();
  3.  
  4. // checkbox
  5. var language = [];
  6. $('input[name=keeper_language]:checked').each(function () {
  7.     language.push($(this).val());
  8. });
  9.  
  10.  
  11. // Radio Button on Change
  12. $("input[name=new_promocode_discount_type]:radio").change(function () {
  13.     console.log('changed type');
  14.     console.log($('input[name=new_promocode_discount_type]:checked').val());
  15.     if($('input[name=new_promocode_discount_type]:checked').val()=="percentage"){
  16.      
  17.     }else if($('input[name=new_promocode_discount_type]:checked').val()=="fixed"){
  18.      
  19.     }
  20.   });
  21.  
  22. // Retrieve Value of Data Attribute
  23. $("#").find(':selected').data('');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement