Sort by what? And do you want to reorder the actual checkboxes, or create a somehow sorted array of their values and output that to parts?
It’s actually possible to refer to the element with that ID like that, however this should better be avoided for various reasons… and then you certainly can’t .sort() or .reverse() a DOM element.