4-5.html

来自「Ajax的例子」· HTML 代码 · 共 39 行

HTML
39
字号
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>单行文本框</title>
<script language="javascript">
function display()
{
alert("第一个文本框中的内容是:"+document.form1.textfield1.value);
}

function transfer()
{
document.form1.textfield2.value=document.form1.textfield1.value;
}
</script>
</head>
<body>
<div align="center">
  <form name="form1" method="post" action="">
    <table width="70%"  border="0">
      <tr>
        <td>第一个文本框
        <input type="text" name="textfield1"></td>
      </tr>
      <tr>
        <td>第二个文本框
        <input type="text" name="textfield2"></td>
      </tr>
      <tr>
        <td align="left">
		<input type="button" name="firstButton" value="显示第一个文本框的内容" onClick="display()">
        <input type="button" name="secondButton" value="导入导第二个文本框中" onClick="transfer()"></td>
      </tr>
    </table>
  </form>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?