XML/HTML代码
- <html>
- <head>
- <script type="text/javascript" src="/jquery/jquery.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $("button").click(function(){
- $("div").text($("form").serialize());
- });
- });
- </script>
- </head>
- <body>
- <form action="">
- username: <input type="text" name="hiusername" value="liuxinxiu" /><br />
- age: <input type="text" name="hiage" value="28" /><br />
- </form>
- <button>序列化表单值</button>
- <div></div>
- </body>
- </html>