Input.htm
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
<style>
input{behavior:url('Input.htc')}
</style>
</head><body>
<input type=text value="文本">
<input type=button value="按钮">
</body></html>

解决方案 »

  1.   

    Input.htc
    <script language=javascript>
    switch(type)
    {
    case 'text':
    case 'password':
    style.border="1px solid #000000";
    style.backgroundColor="#FFFFFF";
    style.height="18px";
    style.font="normal 12px 宋体";
    style.color="#000000";
    break;
    case 'submit':
    case 'reset':
    case 'button':
    style.border="1px solid #000000";
    style.backgroundColor="#CCCCCC";
    style.height="18px";
    style.font="normal 12px 宋体";
    style.color="#000000";
    break;
    default:;
    };
    ;
    onmousedown=function()
    {
    style.color="#0000FF";
    };
    onmouseover=function()
    {
    style.color="#0000FF";
    };
    onmouseout=function()
    {
    if(type=="submit")
    {style.color="#FF0000";}
    else
    {style.color="#000000";}
    };
    onkeydown=function()
    {
    window.confirm("OnKeyDown");
    }
    </script>
      

  2.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title></title>
    <script language=javascript>
    switch(type){
    case 'text':
    case 'password':
    style.border="1px solid #000000";
    style.backgroundColor="#FFFFFF";
    style.height="18px";
    style.font="normal 12px 宋体";
    style.color="#000000";
    break;
    case 'submit':
    case 'reset':
    case 'button':
    style.border="1px solid #000000";
    style.backgroundColor="#CCCCCC";
    style.height="18px";
    style.font="normal 12px 宋体";
    style.color="#000000";
    break;
    default:;
    };
    onkeydown=function(){window.confirm("OnKeyDown");}
    onmousedown=function(){style.color="#0000FF";};
    onmouseover=function(){style.color="#0000FF";};
    onmouseout=function(){
    if(type=="submit"){style.color="#FF0000";}
    else{style.color="#000000";}
    };
    </script>
    </head>
    <body>
    <input type="text" value="文本">
    <input type="button" value="按钮">
    </body>
    </html>