self_example/java_web/JavaScript/html/17-常见事件.html

30 lines
459 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>18-常见事件</title>
</head>
<body>
<form id="register" action="#">
<input type="text" name="username">
<input type="submit" value="提交">
</form>
<script>
document.getElementById("register").onsubmit=function () {
//onsubmit 返回true则表单会被提交返回false则表单不提交
return true;
}
</script>
</body>
</html>