Donald Trump’s kids — and millions of other New Yorkers — should have gotten the chance to vote in last week’s presidential primary but were blocked because of an unconstitutional system, a new lawsuit charges.

Manhattan lawyer Mark Warren Moody has filed a class-action lawsuit against the state and city Board of Elections to overturn the closed-primary system, saying no one should be shut out.

Moody said he unexpectedly found himself in the same boat as Ivanka and Eric Trump last week when he discovered he missed the October 2015 deadline to switch from being an independent to, in his case, a Democrat.

“The Trump children and I, together with millions of other New Yorkers, were disfranchised” by not being allowed to vote, he says in the Manhattan court documents.

A hearing on the issue is set for Friday in Manhattan Supreme Court.

City and state election officials did not return messages for comment.