Spending time in front of the tube not only leads to mindless eating, but also sets children up to prefer unhealthy foods in general.

Donna Day / Getty Images

What you see is what you eat, according to the latest study to confirm that TV viewing encourages children to eat more junk food. But the researchers say there may be an easy way to counter unhealthy snacking in front of the tube, simply by putting healthier foods within easy reach.

Leah Lipsky and Ronal Iannotti, staff scientists at the Eunice Kennedy Shrive National Institute of Child Health and Human Development, report that for every hour of television children watch, they are 8% less likely to eat fruit every day, 18% more likely to eat candy, and 16% more likely to eat fast food. Those results, reported this week in the Archives of Pediatrics & Adolescent Medicine, shore up previous studies that have linked TV viewing with unhealthy eating habits among children.

The reasons for the association aren’t surprising: youngsters watching TV are exposed to more advertising for unhealthy foods, such as for fast food or sodas, than commercials for fresh fruits and vegetables. Kids who watch a lot of TV are also less likely to be active, and studies show they’re more likely to prefer eating foods high in sugar, salt and fat even when they aren’t watching TV.

(MORE: The Sad State of American Kids’ Food Environments)

But Lipsky and Iannotti also found that some kids who snacked in front of the tube increased the amount of fruit they ate. It all depended on what was available and within reach. “Of course, the link was nowhere near as strong as that between TV watching and the increased consumption of candy, soda and fast food in general,” says Lipsky. “But it kind of suggests that if you have other options available, and don’t have the unhealthy options available, then children might be encouraged to possibly eat more fruit.”

That’s the message that the she and Iannotti hope that parents will take away from their study, which involved more than 12,000 students in grades 5 through 10. The researchers asked the children about how much time they spent every day watching TV, using the computer or playing video games, and also asked the students to report on how often they consumed various foods, including fruits, vegetables, soda and fast food.

(LIST: Top 10 Iconic Junk Foods)

The more TV kids watched, the more unhealthy food they ate. Even after accounting for the fact that children sitting in front of the TV or computer might simply eat more overall out of boredom, the relationship between TV time and unhealthy eating habits remained. That suggests that the link goes beyond excessive snacking. “The behaviors we are looking at are part of a pattern of behaviors that are more likely related to obesity,” says Iannotti.

In other words, TV watching can establish a deeper pattern of poor eating habits that can set children up not only for future obesity, but also for many of the chronic diseases associated with overweight, such as diabetes, sleep apnea and heart problems. When children spend more time in front of the screen, they are also less likely to be exercising or engaging in physical activity that can burn off calories and keep the heart healthy.

(MORE: Can Fast Food Toy Bans Really Help Kids Eat Better?)

Lipsky and Iannotti recommend that parents first limit the amount of time children spend in front of a TV or computer — the American Academy of Pediatrics suggests at most two hours a day for the youngest children — and, since avoiding TV altogether is probably unrealistic, at least try to make the TV-watching or computer-using environment healthier by giving children good-for-them snacks such as fruits and nuts. If eating in front of the TV is mindless, then at least snacking on healthy foods can help offset some of the bad behaviors TV promotes.

VIDEO: Online Ads Masquerading as Video Games May Be Making Kids Obese

Alice Park is a writer at TIME. Find her on Twitter at @aliceparkny. You can also continue the discussion on TIME’s Facebook page and on Twitter at @TIME.