我有兩個單選按鈕:JQuery的單選按鈕
<table border="0" width="500">
<tr><td><?php echo form_label('Register with a Club', 'club'); ?> <?php echo form_radio('individual', 'club', '', 'id=club'); ?></td><td><?php echo form_label('Register as an Independent', 'independent'); ?> <?php echo form_radio('individual', 'independent', '', 'id=independent'); ?></td></tr>
</table>
這個吐出:
<table border="0" width="500">
<tr><td><label for="club">Register with a Club</label> <input type="radio" name="individual" value="club" id=club /></td><td><label for="independent">Register as an Independent</label> <input type="radio" name="individual" value="independent" id=independent /></td></tr>
</table>
我想提醒出的單選按鈕組的值....我已嘗試...
<script type="text/javascript">
$(function(){
alert($("input[name='individual']").val());
});
</script>
但它只返回'俱樂部'一次,爲什麼不提醒'獨立'?