0
我正在嘗試使用選定的廣播獲取單元格的內容。 這是我的JavaScript,但它不工作:如何使用選定的收音機獲取表格單元格的內容?
document.getElementById(document.querySelector('input[name="celselectie"]:checked').parentNode).innerHTML=(here some var);
HTML:
<table id="speelveld">
<tr><td><input type="radio" name="celselectie" value="cel001"/></td>
<td><input type="radio" name="celselectie" value="cel002"/></td>
<td><input type="radio" name="celselectie" value="cel003"/></td>
<td><input type="radio" name="celselectie" value="cel004"/></td>
<td><input type="radio" name="celselectie" value="cel005"/></td>
[.......]
<td><input type="radio" name="celselectie" value="cel099"/></td>
<td><input type="radio" name="celselectie" value="cel100 "/></td></tr>
</table>
您沒有一個名爲 「選擇」 任何輸入,你正在使用'celselectie'。 –
哎呀。我正要將單選按鈕的名稱更改爲「選擇」,但忘記了:l – 87387264223462