The following example shows you how to use makeArray function:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<html> <head> <script src="http://code.jquery.com/jquery-1.5.js"></script> </head> <body> <div>United States</div> <div>Japan</div> <div>Germany</div> <div>England</div> <div>France</div> <script> // Collects contents from div var elems = document.getElementsByTagName("div"); //Creates myarray var myarray = jQuery.makeArray(elems); //reversing array myarray.reverse(); // Appending the array to the existing content $(myarray).appendTo(document.body); </script> </body> </html> |
Incoming search terms:
- 2D makeArray jquery
- jquery makearray() exemple
Tagged with: array • Div • Document Body • England • Germany • Gt Japan • Lt • Script Src • United States
Filed under: jQuery
Like this post? Subscribe to my RSS feed and get loads more!




Leave a Reply