日期:2014-05-18 浏览次数:20501 次
<script language="javascript"> function addString(str) { obj=document.getElementById("txt"); obj.focus(); if(document.selection==null) { var iStart = obj.selectionStart; var iEnd = obj.selectionEnd; obj.value = obj.value.substring(0,iEnd) + str + obj.value.substring(iEnd, obj.value.length); } else { var range = document.selection.createRange(); range.text += str; } } </script> <asp:TextBox ID="txt" runat="server" Text="oooooo"></asp:TextBox> <input type="button" value="+" onClick="addString('k')">