function selectex(btnsrc){ if(!btnsrc) btnsrc = "img/btn"; var selects = document.getElementsByTagName("select"); for(var x = 0; x < selects.length; x++){ selectexchange(selects[x]); } } function selectexchange(select){ btnsrc = "img/btn"; var div = document.createElement("div"); div.className = select.style.className; div.style.cssText = select.style.cssText; div.innerHTML="asd"; document.createElement("img").src=btnsrc+"_def.png"; document.createElement("img").src=btnsrc+"_over.png"; document.createElement("img").src=btnsrc+"_down.png"; var btn = document.createElement("img"); btn.src=btnsrc+"_def.png"; btn.align="absmiddle"; btn.onmouseup=btn.onmouseover=function(){this.src = this.src.replace(/_[a-z]*\.png/, "_over.png")} btn.onmousedown=function(){this.src = this.src.replace(/_[a-z]*\.png/, "_down.png")} btn.onmouseout=function(){this.src = this.src.replace(/_[a-z]*\.png/, "_def.png")} select.style.display="none" var table = document.createElement("table"); table.cellPadding = table.cellSpacing = 0; var tr = table.insertRow(0); tr.insertCell(0).appendChild(btn); tr.insertCell(0).appendChild(div); //span.style.border="1px red solid" select.parentNode.insertBefore(table,select); }