Chrome移动端调试onclick事件失效

Chrome移动端调试onclick事件失效,代码很简单

<body>
    <button id="button" onclick="test()">qush</button>
    <script>
        function test(){            var idb = document.getElementById('button');
            idb.addEventListener('click',function(){                console.log('ddd');
            },false)
        }    </script></body>


一只萌萌小番薯
浏览 1202回答 1
1回答

慕尼黑8549860

idb.addEventListener('click',function(){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log('ddd'); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},false)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript