I just came across this - thank you, very cool solution.
I would like to store the IDs of the cards selected in an APEX collection. How to do this in JavaScript? I managed to get the id's in a page item and can do it from there, but I would prefer to do it directly.