扫码关注官方订阅号
认证高级PHP讲师
box.getElementsByTagName('a')[0]
txt[0].style.display = 'none';
你写的 txt[0].style.color = '#f00' 如果有效那你写的 txt.style.display = 'none' 自己不觉得别扭吗
txt[0].style.color = '#f00'
txt.style.display = 'none'
document.getElementsByTagName('a')[0].style.display = "none";
使用getElementsByTagName设置的是一个数组,所以要索引值
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
box.getElementsByTagName('a')[0]
txt[0].style.display = 'none';
你写的
txt[0].style.color = '#f00'如果有效那你写的
txt.style.display = 'none'自己不觉得别扭吗使用getElementsByTagName设置的是一个数组,所以要索引值