它说:
index.html:50 Uncaught TypeError: Cannot read property 'style' of null in function document.getElementById("bp_infinity").style.display = "block";
http://i.stack.imgur.com/hODMO.png
非常感谢您的回答。
最佳答案
DOM准备就绪之前,JS正在执行。
要么将<script>
标记移到</body>
结束标记之前,要么将所有Javascript放在onload函数中,例如.. window.onload = function(){ /** all code goes here **/};
关于javascript - 错误Js无法读取null的 'setAttribute'属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39839382/