Skip to content

Instantly share code, notes, and snippets.

@jlcampana
Created September 9, 2014 09:28
Show Gist options
  • Select an option

  • Save jlcampana/a6efc7f536f7696f006f to your computer and use it in GitHub Desktop.

Select an option

Save jlcampana/a6efc7f536f7696f006f to your computer and use it in GitHub Desktop.
Acceder a un radio button
<br><label>Color: </label>
<ul>
<label class="radio-inline">
<input type="radio" name="color" id="color1" value="label-warning" checked> <h4><span class="label label-warning">Etiqueta</span></h4>
</label>
<label class="radio-inline">
<input type="radio" name="color" id="color2" value="label-danger"> <h4><span class="label label-danger">Etiqueta</span></h4>
</label>
<label class="radio-inline">
<input type="radio" name="color" id="color3" value="label-info"> <h4><span class="label label-info">Etiqueta</span></h4>
</label>
<br><label class="radio-inline">
<input type="radio" name="color" id="color4" value="label-success"> <h4><span class="label label-success">Etiqueta</span></h4>
</label>
<label class="radio-inline">
<input type="radio" name="color" id="color5" value="label-primary"> <h4><span class="label label-primary">Etiqueta</span></h4>
</label>
<label class="radio-inline">
<input type="radio" name="color" id="color6" value="label-default"> <h4><span class="label label-default">Etiqueta</span></h4>
</label>
</ul>
var color = $('input[name=color]:radio:checked').val()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment