首页javascriptanchorjQuery HTML Element - 如何在div元素中安装锚链接

jQuery HTML Element - 如何在div元素中安装锚链接

我们想知道如何在div元素中安装锚链接。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.8.3.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    $(function(){
      $('.first').click(function(){
        $('#load').html('<a href="#" class="second">Twice</a>');
      });
      $('#container').on('click', '.second', function(){
        $('#twice').html('<a href="#" class="third">Third</a>');
      });
    });
});
</script>
</head>
<body>
  <div id="container">
    <a href="#" class="first">Click</a>
    <div id="load"></div>
    <div id="twice"></div>
  </div>
</body>
</html>