這里理解不了,有誰(shuí)能幫忙解釋下嗎?
???function?checkone(){ ????????????var?j=document.getElementById("wb").value; ????????????var?hobby?=?document.getElementById("hobby"+j); ????????????hobby.checked?=?true;????}
???function?checkone(){ ????????????var?j=document.getElementById("wb").value; ????????????var?hobby?=?document.getElementById("hobby"+j); ????????????hobby.checked?=?true;????}
2020-04-20
舉報(bào)
2020-04-22
var?j=document.getElementById("wb").value;
這句是獲取輸入框中的值,比如輸入框中是1,j就為1
var?hobby?=?document.getElementById("hobby"+j);
這一句是把“hobby”和獲取到的? j? 組合? 通過(guò)ID來(lái)獲取對(duì)應(yīng)復(fù)選框的元素
最后一句就不用解釋了。