jQuery日本語リファレンス

jQuery does not mean Japanese Query...

Utilities/API/jQuery - Sample Code

jQuery.makeArray(obj)


            
<!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(){
    
    var arr = jQuery.makeArray(document.getElementsByTagName("div"));
    arr.reverse(); // use an Array method on list of dom elements
    $(arr).appendTo(document.body);

  });
  </script>
  <style>
  div { color:red; }
  </style>
</head>
<body>
  <div>First</div>
  <div>Second</div>  
  <div>Third</div>
  <div>Fourth</div>
</body>
</html>
            
          
[実行結果]
[jQuery.makeArray(obj) の説明へ]