案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/js/jquery.js"></script>
4
<script type="text/javascript">
5
$(document).ready(function(){
6
  $("button").click(function(){
7
    $("input:text").val(function(n,c){
8
      return c + " Gates";
9
    });
10
  });
11
});
12
</script>
13
</head>
14
15
<body>
16
<p>Name: <input type="text" name="user" value="Bill" /></p>
17
<button>设置文本域的值</button>
18
</body>
19
</html>
20