Firefox中的HTML输出元素默认值

时间:2019-03-20 15:01:54

标签: javascript html 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>

更改input的值,然后按重置按钮。在Firefox中,表单重设会将output的值设置为空字符串,而不是其默认值。似乎Firefox无法理解HTMLOutputElement.defaultValue

console.log(document.getElementById('output').defaultValue);
<output id="output">60</output>

这是一个错误吗?

0 个答案:

没有答案