This will run the code when you press (for example) a second radio station. Is that what you meant?
Example: http://jsfiddle.net/z2f5j/
HTML
<input type='radio' name='somename' />one
<input type='radio' name='somename' />two
<input type='radio' name='somename' />βthreeβββ
JQuery
$(':radio[name=somename]:eq(1)').click(function() {
alert('i was clicked');
});β
You can also use an event changeinstead click.
Example: http://jsfiddle.net/z2f5j/2/
$(':radio[name=somename]:eq(1)').change(function() {
alert('i was changed');
});β
source
share