我正在尝试在 jQuery 中触发提交处理程序,但在提交时它会进入操作页面。我究竟做错了什么?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<script>
$('#target').submit(function() {
alert('Handler for .submit() called.');
return false;
});
</script>
<form id="target" action="destination.html">
<input type="text" value="Hello there" />
<input type="submit" value="Go" />
</form>
<div id="other">
Trigger the handler
</div>
</body>
</html>