A jack-in-the-box is a children's toy that outwardly consists of a box with a crank. When the crank is turned, it plays a melody, often 'Pop Goes the Weasel'. At the end of the tune, the lid pops open and a figure, usually a clown or jester, pops out of the box.
Early in the 1500s, a German clockmaker named Claus made a box for a local prince whose son was about to celebrate his fifth birthday. A simple wooden box with metal edges and a handle, and with a turn of the crank produced a simple tune and out popped a 'Jack,' a Devil, a comical version with a leering smile. Other nobles took note of the child's toy and the idea spread. Technology by the 1700s meant that it was a 'common toy' or novelty often in use for all ages. It was around this time that the image of a devil in a box became cartoon fodder for rogue politicians and other public figures held to ridicule.
Another theory as to the origin of the jack-in-the-box is that it comes from the 13th century English prelate Sir John Schorne, who is often pictured holding a boot with a devil in it. According to folklore, he once cast the devil into a boot to protect the village of North Marston in Buckinghamshire. This theory may explain why in French, a jack-in-the-box is called a 'diable en boîte' (literally 'a boxed devil').