FAIR LAWN, N.J. — Faced with a new federal tax law that limits state and local tax deductions, three communities in New Jersey have come up with a novel solution: They want people to donate to a town-run charity as a way of mitigating their property taxes.

The three towns — Paramus, Park Ridge and Fair Lawn — announced on Friday that they would allow residents to donate the same sum they would have been charged in property taxes to pay for municipal services. Under the tax bill signed by President Trump last month, deductions for state and local taxes, including property taxes, are limited, but charitable donations are not.

“The tax hike bill Congress passed last year is a ticking time bomb for New Jersey,” said Representative Josh Gottheimer, a Democrat from northern New Jersey who helped hatch the plan and whose district includes the three communities. “But today, we are proudly declaring that New Jersey won’t shy from a fight. We won’t be America’s piggy bank.”

The move is one example of how states and towns across the country with high tax rates are working feverishly to come up with creative ways to circumvent the federal tax law. In New York, Gov. Andrew M. Cuomo, a Democrat, has threatened legal action and is exploring the possibility of eliminating the state income tax and replacing it with a payroll tax. In California, a new bill proposes setting up a similar charitable contribution system to allow taxpayers to make donations instead of paying certain state taxes.