日期:2014-05-18 浏览次数:21467 次
<style>
input.text{background-color:red}
</style>
<input type="text" class="text">
<input type="text" style="background-color:blue">
------解决方案--------------------
学习....
------解决方案--------------------
楼主的环境问题吧!
------解决方案--------------------
<style>
input.text{background-color:red}
</style>
<script>
function mm()
{
var a = document.getElementsByTagName("INPUT");
for(var i=0; i<a.length; i++) if(a[i].type=="text") a[i].className="text";
}
</script>
<body onload="mm()">
<input/>
<input/>
</body>