<div class="codetitle"> <span><a style="CURSOR: pointer" data="25619" class="copybut" id="copybut25619" onclick="doCopy('code25619')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code25619"> <br><span style="font-family:Times New Roman;font- size:18px;"><script type="text/javascript"> <BR>//將遊標聚焦在文字最後<BR>function cursorEnd(){ <BR>var e = event.srcElement; <BR>var r = e.createTextRange(); <BR>r.moveStart('character',e.value.length); <BR>r.collapse(true); <BR>r.select(); <BR>} <BR></script> <br><input type="text" name="test" value="test" onfocus="cursorEnd()"></span> <br> </div>