What you see: Milky juice coming out of your onion as you chop
What is it: Onion juice!
Eat or toss: Eat! This is a perfectly fine onion.
The onion plant’s ancestors likely evolved bulbs to store water and nutrients over the winter and during droughts. Fast forward to today, and breeders select for onions that are ever more plump and filled with water, sugars and flavorful compounds. What we think of as “layers” of an onion are actually leaves whose primary purpose is storage.
So, slice an onion and you’re slicing open cells and releasing the water and sugars they’d been storing. Sometimes you can actually see the cells' juices as a milky white liquid.
Some onions dribble this milky stuff while you’re cutting them, others don’t. University of Wisconsin horticulture professor Irwin Goldman said the difference may come down to the moisture content in each individual onion. Moisture could be affected by growing conditions, age, and how the onion was handled and cured after harvest. (During "curing" the outer leaves and neck areas are dried to increase the vegetable's shelf life).
In any event, the liquid won’t hurt you and is nothing to worry about. (In fact...It's part of this complete breakfast!)
Irwin Goldman. Horticulture professor. University of Wisconsin.
Onions and Other Vegetable Alliums. James L. Brewster. 2008.
I can't chop onions. I always make them cry.