我有以下HTML
输入:
<input type="number" id="input-number"/>
在我下面的JS
代码中,当我尝试做.value
时userInput
我不能这样做,我只能做.nodeValue
.
为什么是这样?
// elements on page
const userInput = document.getElementById('input-number');
const addBtn = document.getElementById('btn-add');
const subtractBtn = document.getElementById('btn-subtract');