window.document.getElementById("ID").onclick=function(){ }无效,求解答
window.document.getElementById("ID").onclick=function(){ }无效,求解答
日期:2022-04-12 09:51:54 人气:1
页面是从上至下执行的,在js执行时,html中的ID标签还没有加载。
需要把<script>那段放到你的<input>下边即可。
需要把<script>那段放到你的<input>下边即可。