<script type="text/javascript"> $(document).ready(function(){ $("#firstpage").click(); }); </script>
$("button").click(function(){ $("input").trigger("select"); });
$(selector).trigger(event,[param1,param2,...])
<pre name="code" class="javascript">$(selector).trigger(eventObj)
<html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("input").select(function(){ $("input").after("文本被选中!"); }); $("button").click(function(){ $("input").trigger("select"); }); }); </script> </head> <body> <input type="text" name="FirstName" value="Hello World" /> <br /> <button>激活 input 域的 select 事件</button> </body> </html>