只能通过如下方式设置
<style>
input.hrong
{
font-family:arial;
font-weight:bold;
color: red;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
function mm()
{
var a = document.getElementsByTagName("INPUT");
for (var i=0; i<a.length; i++)
if(a[i].type=="text") a[i].className="hrong";
}
</SCRIPT>
<body onload="mm()">
<input><input type=button value=mmm><input type=password>
<style>
input.hrong
{
font-family:arial;
font-weight:bold;
color: red;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
function mm()
{
var a = document.getElementsByTagName("INPUT");
for (var i=0; i<a.length; i++)
if(a[i].type=="text") a[i].className="hrong";
}
</SCRIPT>
<body onload="mm()">
<input><input type=button value=mmm><input type=password>