Ondansetron injection is used to prevent nausea and vomiting caused by cancer chemotherapy and surgery. Ondansetron is in a class of medications called serotonin 5 HT3 receptor antagonists. It works by blocking the action of serotonin which is natural substance that may cause nausea and vomiting.