用户1173044
2015-01-20 16:54
function checkone(){
var j=document.getElementById("wb").value;
var hobby = document.getElementByName("hobby");
hobby[j-1].checked=true;
// 任务3
}
var hobby = document.getElementsByName("hobby");//注意S
Are you sure this works? Because I tried this too but it fails. Here's my code:
function checkone(){
var j=document.getElementById("wb").value;
var hobby = document.getElementByName("hobby");
hobby[parseInt(j)-1].checked=true;}
(I'm sorry I have to type English because the computer I'm using isn't installed with a Chinese input method~~)
是不是这个写错了?document.getElementsByTagName("hobby");
JavaScript进阶篇
468194 学习 · 21891 问题
相似问题