JavaScript事件处理与XML数据处理全解析
1. JavaScript表单处理中的onsubmit和onreset事件
在表单处理中, onsubmit 和 onreset 是两个非常实用的事件。当表单被提交或重置时,这两个事件会分别触发。以下是一个示例代码,展示了如何使用这两个事件:
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Demonstrating the onsubmit and onreset events. -->
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>A Form Using onsubmit and onreset</title>
<style type = "text/css">
.tip { font-family: sans-serif;
color: blue;
font-size: 12px }
</style>
<script type = "text/javascript">
var helpArray =
[ "Enter your name in this input bo
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



