jQuery MisctoArray()Method
Example
Convert the <li> elements into an array, then output the innerHTML of the array elements:
$("button").click(function(){
x=$("li").toArray()
for (i=0;i<x.length;i++)
{
alert(x[i].innerHTML);
}
});
x=$("li").toArray()
for (i=0;i<x.length;i++)
{
alert(x[i].innerHTML);
}
});
Try it Yourself »
Definition and Usage
The toArray() method returns the elements matched by the jQuery selector as an array.
Syntax
$(selector).toArray()
Other Extensions
jQuery Misc Methods