I have the following array:
var elementos = [$("#elemento1"), $("#elemento2"), $("#elemento3")]
I need to create a function that "converts" this array into a jQuery instance, so I can use jQuery functions at all at the same time.
I've tried this:
var elementos = [$("#elemento1"), $("#elemento2"), $("#elemento3")];
$(elementos).hide();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><pid="elemento1">Elemento 1</p>
<p id="elemento2">Elemento 2</p>
<p id="elemento3">Elemento 3</p>
But I did not succeed, I know it would be best to use each. But is this possible?