Hiding form checkbox group elements

How can i hide on the fly (by API call) one or more options belonging to the checkbox group inside a form?