jQuery日本語リファレンス

jQuery does not mean Japanese Query...

Core/API/jQuery - Sample Code

get()


	        
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  <script>
  window.onload = (function(){try{
    function disp(divs) {
      var a = [];
      for (var i = 0; i < divs.length; i++) {
        a.push(divs[i].innerHTML);
      }
      $("span").text(a.join(" "));
    }
    disp( $("div").get().reverse() );
  }catch(e){}});</script>
  <style>
  span { color:red; }
  </style>
<style>html,body{border:0; margin:0; padding:0;}</style></head>
<body>
  Reversed - <span></span>
  <div>One</div>
  <div>Two</div>
  <div>Three</div>
</body>
</html>
            
	      
[実行結果]
[get() の説明へ]