首页javascriptanchorjQuery HTML Element - 如何触发对锚链接的点击

jQuery HTML Element - 如何触发对锚链接的点击

我们想知道如何触发对锚链接的点击。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.5.2.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    $("a").live("click", function(){
        $(this).text("It works!");
    });
    $(document).ready(function(){
        $("a").trigger("click");
    });
});
</script>
</head>
<body>
  <ul id="titleee" class="gallery">
    <li><a href="#inline" rel="prettyPhoto">Talent</a></li>
  </ul>
</body>
</html>