<div class="codetitle"> <span><a style="CURSOR: pointer" data="71227" class="copybut" id="copybut71227" onclick="doCopy('code71227')"><u>复制代码</u></a></span>代码如下:</div> <div class="codebody" id="code71227"> <br>window.onload=function() <br> { <br> var inputs=document.getElementsByTagName("入力"); <br> for (var i=0;i<inputs.length i> if(inputs[i].getAttribute("type")=="text") <br> inputs[i].onkeyup =function(){ <br> this.value=this.value.replace(/(^/s )|/s $/g,""); <br> }; <br> } <br> } <br></inputs.length> </div>