jQuery日本語リファレンス

jQuery does not mean Japanese Query...

Events/API/jQuery - Sample Code

live(type, fn)


            
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="/jquery/js/jquery.js"></script>
  
  <script>
  $(document).ready(function(){
    
    $("p").live("click", function(){
      $(this).after("<p>新たなp要素もクリック!</p>");
    });

  });
  </script>
  <style>
  p { background:yellow; font-weight:bold; cursor:pointer; 
      padding:5px; }
  p.over { background: #ccc; }
  span { color:red; }
  </style>
</head>
<body>
  <p>ここをクリック!</p>
  <span></span>
</body>
</html>
            
          
[実行結果]
[live(type, fn) の説明へ]