If I have a form with 5 children elements, is there a way to swap, for example, the second one and the 4th one via that pseudo array children of the form? Like:
let temp = parent_form.children[1st_swapped_elem_index];
parent_form.children[1st_swapped_elem_index] = parent_form.children[2nd_swapped_elem_index];
parent_form.children[1st_swapped_elem_index] = temp;
But it doesnt work, nothing happens. As the 1st_swapped_elem_index and 2nd_swapped_elem_index there are legal, usable and defined variables, each of them holds a certain DOM element.
forEach
/for
loop?