我的页面上有两个跨度,class='hidden',然后是一些 javascript 在满足条件时删除该类,它在 9/10 和 firefox 中工作正常,但当我在 chrome 中运行该函数时它不能工作chrome JS 控制台我收到消息 TypeError: Cannot read property 'attributes' of null
有人知道发生了什么吗?
<script type='text/javascript' >
function showhidden() {
var att =document.getElementById('hiddentextbox');
att.attributes[0].value='';
att =document.getElementById('hiddentextbox1');
att.attributes[0].value='';
}</script>
谢谢