Sen. Joni Ernst, R-Iowa, discusses taking her Senate salary during a town hall at the University of Northern Iowa in Cedar Rapids on Wednesday. (American Bridge)

Sen. Joni Ernst, R-Iowa, told constituents Wednesday that she was still taking her salary during the government shutdown because she is “working” during it, as more than 400,000 federal employees are being compelled to work without pay.

Ernst also said that, by law, she had no choice but to accept her paycheck, even though many members of Congress have pledged to give their pay to charity or return it to the Treasury.

At a town hall at the University of Northern Iowa in Cedar Falls, Ernst was asked if she was being paid during the shutdown.

“Yes, I am,” Ernst replied, prompting a follow-up question: “Why?”

In footage filmed by American Bridge 21st Century, the senator explained she had no choice since Congress remained funded and that there was “a provision that prohibits us from not taking funds or a salary.”

“I am currently taking a salary. I am working during the shutdown,” she said. “I understand a lot of people don’t like that, but I would rather see no budget, no recess, and actually be in D.C. to solve the issue so we don’t have the shutdown.”

Article I of the Constitution states that senators and representatives “shall receive a Compensation for their Services,” and the 27th Amendment prohibits them from making changes to their pay in the current term.

Still, dozens of representatives and senators from both parties have pledged to return their pay or donate it to charities until the shutdown ends, Roll Call reported.

One Republican senator scoffed at the idea of not keeping his money.

Sen. Kevin Cramer of North Dakota told the Grand Forks Herald that doing so would be “gimmicky.”

“I have no intention of donating my salary while working,” Cramer told the newspaper before he was sworn in on Jan. 3. “The government isn’t shut down, only about 25 percent of it. Some federal employees are getting paid time off.”