Javascript Code for Multiple querySelectorAll() in Specific Order

How to use Javascripts querySelectorAll() in a manner that the elements are return in specific order

Home Short:

Lets say you have a form that has a bunch of input elements that all have the class="profileelem". These elements consist of many different types of input elements including ...

Lets say some of these elements with class="profileelem" are ...

You want to be able to use querySelectorAll in a manner that the elements are return in this specific order

  1. elements with the class="captcha profileelem".
  2. file input elements.
  3. All the remaining elements with class="profileelem"

Method #1 to use querySelectorAll() for multiple elements and have the elements combined in a specific order

How you would use this function ...

Method #2 to use querySelectorAll() for multiple elements and have the elements combined in a specific order

S
H
A
R
E