Combine cauliflower, onions, and salt in a large glass container; cover with ice. Let stand 2 to 3 hours. Drain and rinse 3 times in a cold water bath.
Tie spices in a cheesecloth bag. Combine spice bag, vinegar, and sugar in a stainless steel stockpot. Bring to a boil. Add cauliflower and onions. Reduce heat; simmer 7 minutes, stirring occasionally. Remove spice bag; discard.
Pack cauliflower into hot sterilized jars; cover with syrup, leaving 1/2-inch head space. Remove air bubbles. Cover with metal lids, and screw bands tight. Process in boiling-water bath 10 minutes.