小弟想实现这样的功能该怎么办
小弟页面上面放了一个文本框,想当这个文本框获得焦点时将其颜色该为红色
怎么办,
请教

解决方案 »

  1.   

    javascript应该可以实现
    不会 帮你顶
      

  2.   

    textbox1.Attributes.Add("onFocus", "c=this.style.backgroundColor;this.style.backgroundColor='#6699ff';");
    把上面这句放在Page_Load(object sender, EventArgs e)中;
      

  3.   

    <body onload=document.f.wd.focus()>
     <form name=f><input type=text name=wd class=ff size=35 maxlength=100>
    </form>
    </body>
      

  4.   

    文本框.Attributes.Add("焦点事件名-如 onclick()";颜色值);
      

  5.   

    //****用CSS.mMouseOver
    {
       background-color:#eeccff;
       color:Blue;
       font-family:宋体 AF PEPSI;
       font-size:12px;
       cursor:hand;
    }
    .mMouseOut
    {
     background-color:#ec88ff;
       color:Blue;
       font-family:宋体 AF PEPSI;
       font-size:12px;
       cursor:hand;
    }
    //****调用CSS<input id=txtname onmouseover="this.className='mMouseOver'"
                      onmouseout="this.className='mMouseOut'" type="text"/>