Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save z007/853fdd87462787f68a3d to your computer and use it in GitHub Desktop.
Save z007/853fdd87462787f68a3d to your computer and use it in GitHub Desktop.
按钮 -使用对象事件属性链接事件处理程序
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>按钮四类 text submit resert img</title>
</head>
<body>
<center><h1>按钮对象示例</h1></center>
<form name="myform" action="" method="get"
onreset="return confirm('确定清空文本框?');"
onsubmit="return confirm('确定提交表单?');">
<label>辅助文本框:
<input type="text" value="" onfocus="this.select()" />
</label>
<br/>
<input type="submit" value="提 交">
<input type="reset" value="清 空" >
<br/>
<input type="button" value="单击“提交”按钮"
onclick="document.myform.elements[1].click();">
<br />
<input type="button" value="单击“清空”按钮"
onclick="document.myform.elements[2].click();">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment