Mor*_*ori 5 html javascript forms firefox
<form oninput="result.value=parseInt(a.value)+parseInt(b.value)">
<input type="range" name="b" value="50" /> +
<input type="number" name="a" value="10" /> =
<output name="result">60</output>
<br>
<button type="reset">Reset</button>
</form>Run Code Online (Sandbox Code Playgroud)
更改input值,然后按重置按钮。在Firefox中,表单重设会将output值设置为空字符串,而不是其默认值。似乎Firefox无法理解HTMLOutputElement.defaultValue:
console.log(document.getElementById('output').defaultValue);Run Code Online (Sandbox Code Playgroud)
<output id="output">60</output>Run Code Online (Sandbox Code Playgroud)
是虫子吗?
| 归档时间: |
|
| 查看次数: |
82 次 |
| 最近记录: |