<head>
<style>
.focus{background-color:#ffffff}
.blur{background-color:#3366cc}
</style></head><body>
<input onfocus="style.backgroundColor=''" onblur="style.backgroundColor='#3366cc'">
<input onfocus="className='focus'" onblur="className='blur'">
</body>
<style>
.focus{background-color:#ffffff}
.blur{background-color:#3366cc}
</style></head><body>
<input onfocus="style.backgroundColor=''" onblur="style.backgroundColor='#3366cc'">
<input onfocus="className='focus'" onblur="className='blur'">
</body>
<HEAD>
<TITLE>Script Encoder Sample Page</TITLE>
<style>
.input1{behavior:url("bg.htc")}
</style>
</HEAD>
<BODY>
<input class='input1'>
</BODY>
</HTML>
bg.htc//同一目录
<PUBLIC:COMPONENT>
<PUBLIC:ATTACH EVENT="onfocus" ONEVENT="fos()"/>
<PUBLIC:ATTACH EVENT="onblur" ONEVENT="blu()"/>
<SCRIPT>
function fos(){
style.backgroundColor='#ffffff'
}
function blu(){
style.backgroundColor='#3366cc'
}
</SCRIPT>
</PUBLIC:COMPONENT>
如果用ClassName怎么写啊?
<style>
.input1{behavior:url("bg.htc")}
</style>
后,class="input1"
这样已经有你要的效果了