实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js">
5
</script>
6
<script>
7
$(document).ready(function(){
8
  $("button").click(function(){
9
    $("div").text($("form").serialize());
10
  });
11
});
12
</script>
13
</head>
14
<body>
15
16
<form action="">
17
First name: <input type="text" name="FirstName" value="Mickey" /><br>
18
Last name: <input type="text" name="LastName" value="Mouse" /><br>
19
</form>
20
21
<button>序列化表单值</button>
22
<div></div>
23
24
</body>
25
</html>
26