案例: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
  $(".field").change(function(){
7
    $(this).css("background-color","#FFFFCC");
8
  });
9
  $("button").click(function(){
10
    $("input").change();
11
  });
12
});
13
</script>
14
</head>
15
<body>
16
<button>激活文本域的 change 事件</button>
17
<p>Enter your name: <input class="field" type="text" /></p>
18
</body>
19
</html>
20