Place the sliced onions into a large mixing bowl. Sprinkle over the the salt and mix through. Set aside for 10 minutes.
Mix through the sugar and spices. Transfer the onions to 1 large glass jar, or 2 smaller ones. Pour in enough vinegar until you hit the ⅔ mark, then top it up with water until the onions are just covered.
Seal with a screw-top lid or clamp, gently shake to mix, then refrigerate for at least 2 days before using.