为什么我这样不行
function checkone(){
var j=document.getElementById("wb").value;
var hobby = document.getElementByName("hobby");
hobby[j-1].checked=true;
// 任务3
}
function checkone(){
var j=document.getElementById("wb").value;
var hobby = document.getElementByName("hobby");
hobby[j-1].checked=true;
// 任务3
}
2015-01-20
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~~)
举报