I want to create a set of elements out from an array of ids so that it can be used as a jquery receiver. For example, if I have ids: id1, id2, id3, how can I turn this into a jquery selector so that the corresponding elements appear in this order? Supposing what I want is theJquerySelector, I then would like to apply a jquery operation like this:
theJquerySelector.appendTo($(...))
where $(...) is another jquery selector irrelevant to the question.
You could use
Arraysjoin()method as such;A more jQuery-esque way would be to either write a utility function to do this for you on the jQuery object (and then call it a “plugin”), or to add classes to the relevant elements and select via that.