PEGAR VALOR RADIO


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



Copy this code and paste it in your HTML
  1. $(document).ready(function() {
  2. $('#pegar_valor').click(function() {
  3. var valor = "";
  4. //Executa Loop entre todas as Radio buttons com o name de valor
  5. $('input:radio[name=valor]').each(function() {
  6. //Verifica qual está selecionado
  7. if ($(this).is(':checked'))
  8. valor = parseInt($(this).val());
  9. })
  10. alert(valor);
  11. })
  12. })

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.