<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p id="demo"></p>
<input type="button" id="button" value="8"/>
<script>
button.onclick=function(){
document.querySelector("#demo").innerText = document.querySelector("#button").value;
}
</script>
</body>
</html>
我想多次点击按钮,所以我可以附加按钮的值,并得到这样的输出8888
而不是只有一个数字8
这怎么可能?任何帮助,将不胜感激:)如何启用多个点击按钮?