為什么先用一個(gè)變量str將"hobby"+j 連接,之后的checked無法改變?
??function?checkone(){ ????????????var?j=document.getElementById("wb").value; ??????????? ?????????//?任務(wù)3 ?????????var?str="hobby"+j;? ??????????document.getElementById("str").checked=true; ????????}
2017-08-03
document.getElementById("str").checked=true;
括號(hào)里的str不要加引號(hào),str在這里是變量