Il metodo toArray() di jQuery
Il metodo toArray() di jQuery trasforma un set di elementi in un array JavaScript.
Il metodo toArray() trasforma un set di elementi jQuery in un array JavaScript. Vediamolo in dettaglio.
Sintassi di base
$(elementi).toArray()
Esempio:
alert($('li').toArray());
Che produce:
[<li id="foo">, <li id="bar">]