案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
  <style>p { color:red; }</style>
5
  <script type="text/javascript" src="/js/jquery.js"></script>
6
</head>
7
8
<body>
9
  <p><b>Values: </b></p>
10
  <form>
11
    <input type="text" name="name" value="John"/>
12
    <input type="text" name="password" value="password"/>
13
    <input type="text" name="url" value="http://w3xue.com/"/>
14
  </form>
15
16
<script>
17
    $("p").append( $("input").map(function(){
18
      return $(this).val();
19
    }).get().join(", ") );
20
</script>
21
22
</body>
23
</html>
24