<textarea rows="3" cols="40" id="txt1">123456</textarea>
<input type="button" value="+" onclick="txt1.focus();document.selection.createRange().text='+';">
<input type="button" value="-" onclick="txt1.focus();document.selection.createRange().text='-';">
<input type="button" value="*" onclick="txt1.focus();document.selection.createRange().text='*';">
<input type="button" value="/" onclick="txt1.focus();document.selection.createRange().text='/';">

解决方案 »

  1.   

    <textarea rows="3" cols="40" id="txt1">123456</textarea><input type="button" value="+" onclick="txt1.focus();document.execCommand('paste',false,'+');">
    <input type="button" value="-" onclick="txt1.focus();document.execCommand('paste',false,'-');">
    <input type="button" value="*" onclick="txt1.focus();document.execCommand('paste',false,'*');">
    <input type="button" value="/" onclick="txt1.focus();document.execCommand('paste',false,'/');;"> 
      

  2.   

    <textarea rows="3" cols="40" id="txt1">123456</textarea>
    <input type="button" value="+" onclick="javascript:txt1.value+='+';">