案例: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(" Text marked!");
8
  });
9
  $("button").click(function(){
10
    $("input").select();
11
  });  
12
});
13
</script>
14
</head>
15
<body>
16
<input type="text" name="FirstName" value="Hello World" />
17
<p>请试着选取输入域中的文本,看看会发生什么。</p>
18
<button>触发输入域中的 select 事件</button>
19
</body>
20
</html>
21