Jump to content
GreenSock

Rhaffaele

Sortable

Recommended Posts

Hey Rhaffaele,

 

There's multiple ways to do this. One would be to keep track of the order as the user drags them around. Another way is to just detect the order at the end (when they're submitting). It'd probably be good to use an ID for the parent instead, but you could do something like this one liner:

 

let answerOrder = [];
document.querySelector(".col").querySelectorAll(".tile").forEach(answer => answerOrder.push(answer.id));
// Do what you need to with answerOrder

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×