onblue="ChangeBlue()"
onfocus="ChangeFocus()" var ChangeBlue=function(){
   id.style="CSS样式";
};var ChangeFocus=function(){
  id.style="CSS样式";
};

解决方案 »

  1.   

    这样没有用的。有没有更好的方法啊!
    var type1 =document.getElementsByTagName("input");
    for(var i=0;i <type1.length;i++){
        if(type1[i].type=="text"){

    type1[i].className='input1';

    }
    }
    我想在if里面应用到onblur,onfocus并为他们赋不用的样式名
    谁有好的方法啊!
      

  2.   

    var trSelected = eval("tr_" + (inputID.split("_"))[1]);
    if (downOrup == 'down') {
    trSelected.style.backgroundColor = "ffcc66";
    }
    else {
    trSelected.style.backgroundColor = "";
    }
      

  3.   

    神呀,你直接用innerHTML把那块儿按你想的样子写出来算了
      

  4.   

    不好意思,忘记了还有一情况,就是onblur和onfocus不能写在<input >文本框中
      

  5.   

    var type1 =document.getElementsByTagName("input"); 
    for(var i=0;i  <type1.length;i++){ 
        if(type1[i].type=="text"){ 
    alert(type1[i].id);
    type1[i].style.color="yellow";
    type1[i].onblur = function(){this.style.color ='red' }
    type1[i].onfocus = function(){this.style.color ='green' }