<script src="jquery-1.6.4.js" type="text/javascript"></script>
<input>aaaaaaaa
<input name="Fruit1" type="radio" checked />苹果
<input name="Fruit2" type="radio" checked />橘子
<input name="Fruit3" type="radio" value="" />香蕉
<script>
var checkedValue;
var elements = document.getElementsByTagName('input');
for (var i=0;i<elements.length;i++){
console.log(elements[i].type);
console.log(elements[i].name);
console.log(elements[i].checked);
if (elements[i].type == 'radio' && elements[i].name == 'Fruit2' && elements[i].checked){
alert('aaaa');
}
}
</script>
<script src="jquery-1.6.4.js" type="text/javascript"></script>
<input>aaaaaaaa
<input name="Fruit1" type="radio" checked />苹果
<input name="Fruit2" type="radio" checked />橘子
<input name="Fruit3" type="radio" value="" />香蕉
<script>
console.log($('input:radio[name="Fruit2"]:checked').val();
</script>
<script src="jquery-1.6.4.js" type="text/javascript"></script>
<input>aaaaaaaa
<input name="Fruit1" type="radio" checked />苹果
<input name="Fruit2" type="radio" checked />橘子
<input name="Fruit3" type="radio" value="" />香蕉
<script>
if ($('input:radio[name="Fruit2"]:checked').val()){
alert('aaa');
};
</script>