<html>
<head>
<title>测试form</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
</head>
<body>
<form>
<input type="text"></input>
<input type="text"></input>
<button>测试</button>
</form>
<script type="text/javascript">
$(document).ready(function(){alert('refurbish');});
</script>
</body>
</html>没有给button绑定任何事件,但是点击button页面还是刷新了,这个是为什么呢?
是from自身的设定还是其他原因?高手解答一下,谢谢!
<head>
<title>测试form</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" type="text/javascript"></script>
</head>
<body>
<form>
<input type="text"></input>
<input type="text"></input>
<button>测试</button>
</form>
<script type="text/javascript">
$(document).ready(function(){alert('refurbish');});
</script>
</body>
</html>楼主在耍我们吧?
在页面加载的时候确实有个弹出框, 但点击按钮是不可能有什么动作的。
<html>
<head>
<title>测试form</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){alert('refurbish');});
</script>
</head>
<body>
<form>
<input type="text"/>
<input type="text"/>
<input type="button" value="测试" />
</form>
</body>
</html>
是浏览器行为还是form自身的标准就是这样设定,还是其他的原因,我更想知道的是这些!
这种浏览器正常来说都是一个规则!
替换
<button>测试</button>