<input type="radio" name="a" value="a1">
<input type="radio" name="b" value="b1">
<input type="radio" name="c" value="c1">
<input type="radio" name="d" value="d1">
<script>
document.onclick=c;
function c(){
var o=event.srcElement;
if(o.tagName=="INPUT"){
if(o.type=="radio")alert(o.name+"被先中\r\n它的值是"+o.value)
}
}
</script>
<input type="radio" name="b" value="b1">
<input type="radio" name="c" value="c1">
<input type="radio" name="d" value="d1">
<script>
document.onclick=c;
function c(){
var o=event.srcElement;
if(o.tagName=="INPUT"){
if(o.type=="radio")alert(o.name+"被先中\r\n它的值是"+o.value)
}
}
</script>
解决方案 »
- 用coolite制作的页面怎么快速转成ExtJS制作的页面?
- Google maps API求助
- 【100分】如何重写jquery.autocomplete.js的完成事件?
- javascript 奇怪问题 有来回答下么???
- 纯Javascript的剑三连连看
- 效果问题
- 如何用脚本控制图片或者flash只出现一次
- img src 用js来定义不被执行
- 请教什么可以使框架的一个页面每次刷新内容都停在页面最底段呢???
- 想实现一个功能 当选择表单select0里边的“产品分类“,然后自动探出另外一个select1表单,选择select1表单里边的分类信息搜索,选择表单
- 如何判断一个button被按下?
- 请问能不能把文件存在邮箱中,然后用一个地址链进去,下载文件或显示图片?
<input type="radio" name="b" value="b1">
<input type="radio" name="c" value="c1">
<input type="radio" name="d" value="d1">
<script>
var a = document.getElementsByTagName("input");
for (var i=0; i<a.length; i++){
if ((a[i].type == "radio")&&(a[i].checked))
alert(a[i].name+"被先中\r\n它的值是"+a[i].value);}
</script>
<input type="radio" name="a" value="b1">
<input type="radio" name="a" value="c1">
<input type="radio" name="a" value="d1"><input type=submit onclick=c()>
<script>
function c(){
var a = document.all["a"];
for (var i=0; i<a.length; i++){
if (a[i].checked)
alert(a[i].name+"被先中\r\n它的值是"+a[i].value);}
}
</script>