How to access all items in onEnd option #2248
Unanswered
lukaszokaj
asked this question in
Q&A
Replies: 1 comment
-
document.querySelectorAll('#my-sortable-element input[type="file"]).forEach((element, counter) => {
element.setAttribute('name', `image_${counter + 1}`);
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sorts divs with input type file. These inputs have their own unique names (image_1,image_2, image_3). After sorting(onEnd), I would like to loop through each one and rename them so that from right to left they are image_1, image_2, image_3, because the order is important as image_1 will be the main image. How to get to the list of items?
Beta Was this translation helpful? Give feedback.
All reactions