What a bonehead!

A Bronx science teacher lost his job when he chose to teach elementary school kids about static electricity — by stroking a balloon held at his genitals.

But while axed PS 41 teacher Barry Selman admits the move was “100% inappropriate,” he’s still suing to get his job back.

Selman was canned this month for the juvenile stunt and for making a crude remark about his boss.

His suit claims the firing was a “draconian, excessive and shocking” penalty.

In a cringeworthy Department of Education hearing, Selman’s paraprofessional testified that Selman, while standing in front of his second-grade class, “placed a 6- to 8-inch-long, 3- to 4-inch-wide balloon to his crotch area. He was waving it up and down and stated to her, ‘This is for your daughter.’”

Shortly after the October 2013 incident, Selman’s mostly male, largely learning-disabled students started “using pencils, rulers, staplers, whatever they could, and putting them against their bodies at the area of their penises,” according to the DOE ruling that led to his ouster.

When a guidance counselor asked the boys to stop, they said, “Why? Mr. Selman does it,” the ruling says.

Remarkably, Selman, 39, hung on to his job until March 2015, when he said to a female co-worker, referring to his principal, “She can suck my d–k.”

Selman was removed from the classroom and was been working in an administrative position until he was terminated on Aug. 1.

The $88,000-a-year teach says in his suit that the DOE hearing officer relied on “hearsay statements” and didn’t give enough consideration to his “16 years of unblemished service” prior to the balloon incident.

Selman and his lawyers did not immediately return calls for comment.

A spokesman for the city Law Department said, “We’ll work toward getting this petition dismissed.”