By changing the display style of the button, the button can be dynamically slid Copy the code The code is as follows: < ;html xmlns="http://www.w3.org/1999/xhtml"> Untitled Document <br><br>.search{ background: #008800; color:#fff; border:none; height:26px; line-height:20px; width:63x;} <br>.searchhover{background:#000099; color:#fff; border:none; height:26px ; line-height:20px; width:63px; } <br> <br><br>function js() <br>{ <br>/ / Make ie6 button support hover attribute obj is the entity to support hover. Hover is the style of btn:hover, init is the initial style <br>obj="btn"; <br>alert(navigator.appName); <br>if( navigator.appName == "Microsoft Internet Explorer" && parseFloat(navigator.appVersion) == 4){// Judge ie6 <br>var o = document.getElementsByName(obj); <br>for(var i=0;i< ;o.length;i ){ <br>if(o[i].type == "button"){ <br>//o[i].className = "search"; <br>o[i]. onmouseover = function(){ this.className = "searchhover"} <br>o[i].onmouseout = function(){ this.className = "search"}; <br>} <br>} <br>} <br>} <br>