Why let a little thing like the US Constitution get in the way of a dig at President Trump? That’s the attitude of the Democrats who run the Golden State.

No joke: California Gov. Gavin Newsom just signed a law Tuesday that aims to bar Trump’s name from the state’s primary ballot unless he releases his tax returns for the past five years, which Trump refuses to. Several other states, including New York and New Jersey, have eyed similar bills.

Dems pushing such laws see them as a win-win: If the president releases his returns, they can mine them for evidence, however weak, to justify new witch hunts and calls for impeachment. If not, they keep him off the ballot, harming his re-election chances.

Except that it’s almost surely unconstitutional — as then-Gov. Jerry Brown, a lifelong Democrat, noted when he vetoed a similar bill in 2017: “A qualified candidate’s ability to appear on the ballot is fundamental” to democracy, he noted. Banning candidates is what nations like Russia and Iran do.

“Today we require tax returns, but what would be next? Five years of health records? A certified birth certificate?” Brown asked. “And will these requirements vary depending on which political party is in power?”

The Constitution spells out requirements — a minimum age (35), US citizenship and 14 years of US residency — for presidents. And the Supreme Court has ruled, regarding congressional term limits, that states can’t set requirements for federal ballots beyond what’s in the Constitution.

So all California has done is set up Trump for yet another victory — this time, in court.