40个迹象表明你还是PHP菜鸟
2013-04-22 11:28
211 查看
实验的代码如下:
<!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>你好</title>
</head>
<script language="javascript">
function sub(a,b){
alert(a.value);
alert(b.value);
}
</script>
<body>
<form action="sub" method="post" name="myForm">
<p>First name: <input type="text" id=test1 name="fname" /></p>
<input type="button" value="Submit" onclick="sub(this,document.myForm.fname)" />
</form>
</body>
</html>
总结:
onclick="sub(this,document.myForm.fname)" 中的this是返回按钮的id
<!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>你好</title>
</head>
<script language="javascript">
function sub(a,b){
alert(a.value);
alert(b.value);
}
</script>
<body>
<form action="sub" method="post" name="myForm">
<p>First name: <input type="text" id=test1 name="fname" /></p>
<input type="button" value="Submit" onclick="sub(this,document.myForm.fname)" />
</form>
</body>
</html>
总结:
onclick="sub(this,document.myForm.fname)" 中的this是返回按钮的id
相关文章推荐
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 转:40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟(reship)
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 有以下40个迹象表明你还是PHP菜鸟
- 40个迹象表明你还是PHP菜鸟
- 小心了,40个迹象表明你还是PHP菜鸟