<script language="javascript">
document.onclick = function(){
if(event.srcElement.type == "pwd"){
document.getElementById("pwd").value += event.srcElement.innerText.toString();
}
}
</script>
<table width="230" height="80" border="0">
  <tr>
    <td align="center"><label>
      <input name="pwd" type="text" id="pwd" value="" />
    </label></td>
  </tr>
  <tr>
    <td align="center"><a href="#" type="pwd">0</a>&nbsp;<a href="#" type="pwd">1</a>&nbsp;<a href="#" type="pwd">2</a>&nbsp;<a href="#" type="pwd">3</a>&nbsp;<a href="#" type="pwd">4</a>&nbsp;<a href="#" type="pwd">5</a>&nbsp;<a href="#" type="pwd">6</a>&nbsp;<a href="#" type="pwd">7</a>&nbsp;<a href="#" type="pwd">8</a>&nbsp;<a href="#" type="pwd">9</a></td>
  </tr>
</table>

解决方案 »

  1.   

    <BODY>
    <form name="form1" method="post">
    <td><textarea name="sdf3" id="sdf3" class="textarea5" style="width:500;height:120"></textarea>
    </td>
    <table width="790" border="0">
      <tr>
        <td width="164"><br/><br/><table width="161" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" align="center"><input name="newq22" type="button" class="button1"  id="newq2" onClick="sdf3.innerText = sdf3.innerText+'a'" value=" a "></td>
            <td height="30"><input name="newq222" type="button" class="button1"  id="newq22" onClick="sdf3.innerText = sdf3.innerText+'b'" value=" b "></td>
          </tr>
          <tr>
            <td height="30" align="center"><input name="newq223" type="button" class="button1"  id="newq222" onClick="sdf3.innerText = sdf3.innerText+'c'" value=" c "></td>
            <td height="30"><input name="newq224" type="button" class="button1"  id="newq223" onClick="sdf3.innerText = sdf3.innerText+'d'" value=" d "></td>
          </tr>
          <tr>
            <td height="30" align="center"><input name="newq225" type="button" class="button1"  id="newq224" onClick="sdf3.innerText = sdf3.innerText+'e'" value=" e "></td>
            <td height="30"><input name="newq226" type="button" class="button1"  id="newq225" onClick="sdf3.innerText = sdf3.innerText+'f'" value=" f "></td>
    <td height="30"><input name="clear" type="reset" class="button1"  id="clear" onclick="document.form1.reset()" value=" clear "></td>
          </tr>
        </table></td>
    </BODY>
    <input name="addOption" type="button" value="+" onclick="window.clipboardData.setData('text', this.value);document.getElementById('sdf3').focus();document.execCommand('PASTE');">
    <input name="addOption" type="button" value="-" onclick="window.clipboardData.setData('text', this.value);document.getElementById('sdf3').focus();document.execCommand('PASTE');">
    <input name="addOption" type="button" value="*" onclick="window.clipboardData.setData('text', this.value);document.getElementById('sdf3').focus();document.execCommand('PASTE');">
    <input name="addOption" type="button" value="/" onclick="window.clipboardData.setData('text', this.value);document.getElementById('sdf3').focus();document.execCommand('PASTE');">