What do you get when you combine carnivals, candy and costumes? Purim, of course!

Purim, celebrated this year on Feb. 24, is one of the most joyous of Jewish celebrations, and the holiday is filled with happy traditions. Children — and adults — look forward to eating hamantashen, shaking groggers (noisemakers) and dressing up in costumes.

Most of us get the idea of the hamantashen — the pointy pastries represent the ears of evil Haman (or his three-cornered hat, depending on the tale you were told). And we understand that we make noise during the megillah (story of Purim) reading to drown out the sound of Haman’s name. But why, exactly, do we dress up in costume?

“There really isn’t one main reason why we dress in costume on Purim,” said Rabbi Dalia Samansky, a Valley-based rabbi with the Florence Melton School of Adult Jewish Learning. “One idea that has been cited is the concept of hiddenness. Interestingly, God’s name is never mentioned in the megillah — his presence is hidden in the story.”

Instead, the focus is on a Jewish heroine named Esther.

“The miracle of the Purim story is right in your face — that the king chooses Esther to be his queen,” Samansky said.

And yet we know that God still has a role here, even if it’s not made explicit. By putting Esther in the right place at the right time, she is able to save the Jews of Persia from extermination.

Esther’s name is Persian; however, in Hebrew, Samansky says, it comes from the word “hidden.” Since God’s involvement is masked, it became a tradition to mask ourselves. It’s also worth noting how Esther hid her Jewish identity from the king.

From there, many girls began dressing up as Queen Esther, and boys as Mordecai, Esther’s cousin. Eventually, some Jewish communities adopted the idea of wearing any and all types of costumes. So these days, depending on the congregation, you might find a few Queen Esthers and Mordecais listening to the megillah alongside a group of Transformers and Disney princesses.

This begs the question: How did we move from only dressing up as the Jewish heroes of the Purim story to an anything-goes mentality?

“I am not bothered by the plethora of costumes,” Samansky said. “Kids love coming to temple to celebrate, and they are still getting the idea of being someone they are not, being hidden — just as each of our characters in the story was asked to be someone they were not.”

For many American Jews, the shift in costumes might stem from a purely practical angle. Because many Jewish children dress up for Halloween in October, the costumes can be used again for the Purim celebration.

One major misconception has resulted from the costume component of Purim: “Purim is not the Jewish Halloween,” Samansky said. “On Halloween, we go door-to-door asking for candy. On Purim, we give people candy (or other treats). It is the epitome of Judaism: We give rather than receive.”

While the tradition of dressing up may make the holiday more fun for children, it is not one of the two mitzvot required of us on Purim.

“We are commanded only to listen to the reading of the megillah and to give mishloach manot [baskets of food items] to our friends and neighbors,” Samansky said.

It’s nice, though, to be mindful of the courage of those in the story of Purim. When we dress in costume, sometimes we take on the persona of the character. It’s not uncommon, for example, for a little boy dressed as Superman to pretend he can fly or lift a car. Perhaps the costumes of Purim give us a modern taste of the strength and courage Esther and Mordecai used to confront Haman and save the Jews of Persia.

Today, when we dress in costume on Purim, we celebrate the fact that God was with the Jewish people, even though his presence was hidden at the time. It also helps us remember that it’s not always easy to do what is required of us, but we can find the strength — just like Esther and Mordecai.

Sometimes being just a little bit out of character can give us needed inspiration. Sometimes it is just plain fun!