var trs = document.getElementsByTagName("tr");
trs[0].className="color2"; //设置css样式。 不兼容火狐!
兼容火狐,ie的写法为:
var cls = trs[0].getAttribute('class'); // 添加classtrs[0].setAttribute('class', cls + ' color3');
Powered by: 博客园 Copyright © 2024 曙光城邦 Powered by .NET 8.0 on Kubernetes