No one knows for certain where and when the first jack-in-the-box toy was made, but the toy can be reliably traced back to the Middle Ages. A brightly painted box with a hinged lid and a crank, when the crank is turned a melody plays, much like a music box. Unlike a normal music box, this box holds a surprise--the 'jack' inside the box, popping out on a spring when the melody ends and the lid is unlatched.
One of the earliest documented jack-in-the-boxes was made by a German clock maker in the early 1500s. It was a gift for the son of a local Prince on the boy's fifth birthday. A plain wooden box with metal edges and a crank handle, it played a simple tune and the 'jack' was a comical devil with a 'leering smile'--according to a pamphlet published by the Nuremburg Toy Museum. When other nobles requested a "Devil-in-a box" for their own children, a trend took off that continues to this day.
Improved toy mechanisms in the 18th century allowed the toy to be more easily produced. Not just for royalty any longer, the toy became a common plaything. The image of the jack/devil in a box became a popular cartoonists image for poking fun at politicians. This caused jack-in-the-boxes to be made for adults with the 'jack' being a caricature of some politician of the day.
The most widely accepted theory about the origin of the jack-in-the-box relates the toy to an English churchman from the 13th century, Sir John Schorne. Folklore credits Sir John with casting a devil into a boot to protect the Buckinghamshire village of North Marston. There are engravings from that era of Sir John holding a boot with a devil peeking out the top, which may have inspired the medieval toy makers.
Jesters and More
Sometime during the Renaissance, Jesters began to replace devils as the popular pop-up figure inside the box. In the 1930s and 1940s, jack-in-the-box toys that had boxes made from stamped tin became quite popular. They were lighter weight and easier to mass-produce. Many boxes had nursery rhyme themes, thus a box might play the tune "Mary Had a Little Lamb" and the 'jack' would be a lamb. Clown-like figures still remain very popular jack-in-the-box inhabitants, even though modern 'jacks' can be anything form dragons or bears to pirates or ninjas.
The Encyclopedia of American Folk Art credits the element of surprise for the enduring popularity of the jack-in-the-box. For some reason, people continue to be amused and delighted by the toy, even once they know what will happen when they turn the crank. Perhaps the suspense of the randomly triggered pop-up provides enough entertainment for the child in everyone.