LOS ANGELES (Reuters) - County lawmakers in California’s famed Silicon Valley have passed a law that would prevent restaurants from giving away free toys and other incentives with unhealthy kids’ meals.

McDonald’s Corp’s helped build demand for its “Happy Meals” by including free toys for children and the practice of giving away free goodies with kids’ meals is now common.

While McDonald’s and its rivals have introduced healthier meal options for children, some critics say they have not done enough to fight childhood obesity -- a battle that California’s lawmakers are more than willing to take on.

California was first to institute a state-wide ban on soda in public schools and state lawmakers now are weighing a proposal to tax full-calorie sodas and other sweetened beverages.

The bill, approved on Tuesday by Santa Clara County’s Board of Supervisors, would set basic nutritional standards for children’s meals and only allow restaurants to give away toys with meals that meets national nutritional criteria for children.

For example, backers said restaurants would be banned from using toys as rewards for buying food that has excessive calories -- more than 120 calories for a beverage, 200 calories for a single food item or 485 calories for a meal. There also would be limits on sodium, excess fat and excess sugar.

“This ordinance levels the playing field,” said Ken Yeager, president of Santa Clara County’s Board of Supervisors, who hopes to inspire other lawmakers to pass similar bills.

“It helps parents make the choices they want for their children without toys and other freebies luring them toward food that fails to meet basic nutritional standards,” he said.

Backers of the law, which takes aim at childhood obesity, say it is the first of its kind. In Santa Clara County, one in four youth are either overweight or obese.

The ordinance, which must get a second reading on May 11 to confirm its passage, applies to unincorporated areas of Santa Clara County. The county’s major cities, including San Jose, Cupertino and Palo Alto would not be affected.

Restaurants will be granted a 90-day grace period before the law goes into effect. During that time, they will have an opportunity to propose alternative measures.

McDonald’s and rival Burger King -- under pressure from consumers and health experts -- have taken some steps to make meals for children more healthy. Among other things, parents that order such meals can swap juice or milk for soda or order apple “fries” rather than french fries.

And the industry’s representative has come out against the new law.

“Ultimately, parents decide what their children eat and whether a meal includes a toy or not -- that is the role of a parent,” said Jot Condie, president of the California Restaurant Association. “The county government does not need to serve as the parent of the parents.”