Tutorials References Exercises Bootcamp Menu
Sign Up Create Website Get Certified Pro

jQuery Misc toArray() Method

❮ jQuery Misc Methods


Convert the <li> elements to an array, then alert the innerHTML of the array elements:

  var x = $("li").toArray()
  for (i = 0; i < x.length; i++) {
Try it Yourself »

Definition and Usage

The toArray() method returns the elements matched by the jQuery selector as an array.



❮ jQuery Misc Methods