<input type="text" onfocus="this.style.borderColor='red'" onblur="this.style.borderColor='blue'" style="borderColor='blue' ">

解决方案 »

  1.   

    <input type="text" onfocus="aa(this)" onblur="bb(this)"><script>
    function aa(a){
    a.style.borderColor="red";}
    function bb(b){
    b.style.borderColor="blue";}
    </script>
      

  2.   

    是这样的 因为有很多页面而且每个页面上控件有几百个 不可能在每个文本框上写一个光标移走的事件 所以我想把光标移走的事件写在js里面 但是因为文本框报错光标定位在里面了,再在js方法里面判断光标移走好像不行的,所以问问大家有没有解决办法
      

  3.   

    <style type="text/css" media="all" title="Default">
    .mycss {
    color:red;
    never-online:expression(onfocus=function(){
    this.style.color="blue";
    },onblur=function(){
    this.style.color="red";
    })
    }
      </style>
      <body id="www.never-online.net">
    <input class="mycss" value="never-online"/>
    </BODY>
    </HTML>
      

  4.   

    <style type="text/css" media="all" title="Default">
    .mycss {
    color:red;
    never-online:expression(onfocus=function(){
    this.style.borderColor="blue";
    },onblur=function(){
    this.style.borderColor="";
    })
    }
      </style>
      <body id="www.never-online.net">
    <input class="mycss" value="never-online"/>
    </BODY>
    </HTML>