任何人都可以解释为什么我不能在表格中使用oninput以及我如何让它工作?
例如,这有效:
<form onsubmit="return false" oninput="o.value = parseInt(a.value) + parseInt(b.value)">
<input name="a" type="number" step="any"> +
<input name="b" type="number" step="any"> =
<output name="o"></output>
</form>
这不是:
<table>
<form onsubmit="return false" oninput="o.value = parseInt(a.value) + parseInt(b.value)">
<input name="a" type="number" step="any"> +
<input name="b" type="number" step="any"> =
<output name="o"></output>
</form>
</table>
答案 0 :(得分:0)
<form onsubmit="return false" oninput="o.value = parseInt(a.value) + parseInt(b.value)">
<table>
<input name="a" type="number" step="any"> +
<input name="b" type="number" step="any"> =
<output name="o"></output>
</table>
</form>