WASHINGTON — Voters kept their anger and disillusionment in check in state and local elections this week, generally preferring to keep things the way they are rather than join ideological battles at a time of stubborn joblessness. But the closeness of some contests suggested highly competitive races are in store for 2012, particularly in presidential battleground states.

If anything, the outcomes across a wide range of races and ballot initiatives suggested that some of the tea party-inspired fervor that swept the 2010 midterm races may have cooled and that voters were focusing more on bread and butter issues, with some 25 million Americans still out of work or underemployed after the deepest recession since the 1930s.

Aggressive initiatives in Mississippi to define life as beginning at conception and in Ohio to restrict collective-bargaining rights for public workers were defeated, while incumbents in both parties generally prevailed.

Democrats retained their firm control of the New Jersey Legislature, despite the popularity of Republican Gov. Chris Christie. And they clung to a narrow majority in the Iowa Senate.

Democrats were quick to celebrate their victories, especially in Ohio. But Republicans cheered Ohio’s offsetting rebuke to President Obama’s health care law and a key victory in Virginia that appeared likely to hand Republicans effective control of the state Senate.

By a wide margin, Ohio voters defeated a collective-bargaining measure backed by Republican Gov. John Kasich that would have restricted the powers of labor unions representing 350,000 teachers, police officers and other public-sector workers.

“It’s clear there has been class warfare from the top in this country. The middle class pushed back last night,” Sen. Sherrod Brown, D-Ohio, asserted in a conference call with reporters.

Yet, cutting the other way, Ohio voters approved a largely symbolic measure to exempt state residents from the individual-mandate provision of Obama’s health-care law requiring everyone to carry health insurance.

The vote could embolden other challenges of the law and temper Democratic enthusiasm, suggesting a tough slog still ahead.

Republicans said they were heavily outspent by Democrats on the collective bargaining issue in Ohio, while the anti-health care initiative got 80,000 more votes than the anti-union one.

In Virginia, Republicans failed to wrest from Democrats outright control of the Senate, but were poised to gain a 20th seat and pull even with Democrats in the 40-member chamber.

Virginia went for Obama in 2008 but elected Republican Bob McDonnell as governor in 2009. The state clearly will be tougher turf for Obama next year than the first time around.

Looking at the picture both in Virginia and nationally, “Democrats can be more encouraged than Republicans,” said University of Virginia political scientist Larry Sabato. But, he said, “It’s a patchwork of local elections and issues, so you don’t want to go too far in interpreting them.

“It was more status quo than one would have expected for a time of great economic distress,” Sabato said.