案例: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
  $("input").select(function(){
7
    $("input").after("文本被选中!");
8
  });
9
  var e = jQuery.Event("select");
10
  $("button").click(function(){
11
    $("input").trigger(e);
12
  });
13
});
14
</script>
15
</head>
16
<body>
17
<input type="text" name="FirstName" value="Hello World" />
18
<br />
19
<button>激活 input 域的 select 事件</button>
20
</body>
21
</html>
22