遍历控件并赋属性

function changeImageButton()
{
   var inputs=document.getElementsByTagName("input");
               
    for(var i=0;i<inputs.length;i++)
    {
      if(inputs[i].type.toLowerCase()=="image")
          {
               inputs[i].onmouseover=function(){this.style.border="1px solid #003366";}
               inputs[i].onmouseout=function(){this.style.border="0px solid #003366";}
          }
               
    }
}

posted on 2010-01-19 10:25  tongdengquan  阅读(93)  评论(0编辑  收藏  举报