jack-in-the-box
n.
1560s, originally a name for a sharp or cheat, "who deceived tradesmen by substituting empty boxes for others full of money" [Robert Nares, "A Glossary of Words, Phrases, Names, and Allusions," London, 1905]. As a type of toy, it is attested from 1702.