Shakespeare’s tragedy becomes a girl-power romp in a cotton candy jukebox musical, featuring songs by the Swedish hitmaker Max Martin.They don’t even bother to hide the jukebox. It’s right there, out in the open, before the show starts: a chrome Cyclops glowering at you from the stage of the Stephen Sondheim Theater, of all places.Are you daring me, “& Juliet”?I have done everything a critic can do to stamp out the jukebox musical. I’ve called it a cockroach, a straitjacket, a leech, a dead fish. I’ve argued that, with few exceptions, it’s a form that’s satisfactory neither as music nor as theater, let alone the combination. I’ve stood proudly, even among my colleagues, as a denier of everything that shows like “& Juliet” typically stand for.So shoot me: I liked it. It felt so wrong; it felt so right.This even though “& Juliet,” which opened Thursday on Broadway after establishing itself as a hit in London, trails the faint odor of carpetbagging and brand extension that makes other examples of the genre — “Motown: The Musical,” “Tina: The Tina Turner Musical” and the inexcusable “Escape to Margaritaville” — so dispiriting. The show’s entire reason for being, after all, is to exploit the back catalog of Max Martin, the Swedish hitmaker behind Katy Perry’s “I Kissed a Girl” and 24 other No. 1 singles on the Billboard Hot 100 since 1998.That the songs are good to begin with — chunky, hooky, belty, dancy — is neither here nor there; they generally are, in shows like this, or there would be no audience to pander to. Also par for the course is the way “& Juliet” wedges them into unlikely contexts, aiming for laughs that are little more than Pavlovian reactions to anticipated familiarity.What saves “& Juliet” from being a lowest-common-denominator corporate byproduct is something else, something I never expected: wit.The wit operates on many levels in the director Luke Sheppard’s super-poppy production, including hilarious hybrid Elizabethan costumes (by Paloma Young) that feature a codpiece the size of a snapping turtle, cotton-candy lighting (by Howard Hudson) and playful sets (by Soutra Gilmour) situating the story in a century somehow combining the 16th and ours.Stark Sands, left, as Shakespeare and Betsy Wolfe as Anne Hathaway in the musical. The couple’s marital issues play out alongside Juliet’s new story.Sara Krulwich/The New York TimesBut that’s just the surface; more important are some fundamental choices about what a jukebox can and should be. For one thing, “& Juliet” is not — like “Jersey Boys” and “The Cher Show” — a biomusical, chronicling artists’ ups and downs no matter how jimmied or flat-out falsified. Martin having no taste for the spotlight, it instead opts for an original story, if you can consider a reboot of “Romeo and Juliet” original. Making that story a fable — not unlike “Head Over Heels,” the Go-Go’s romp from 2018 — smartly relieves it of the pressure of reality.But the book, by David West Read, aims higher than that. Because so many of Martin’s biggest songs featured singers like Perry, Britney Spears, Pink and Ariana Grande — Taylor Swift’s are mysteriously absent from the show — the choice to focus on a young woman made sense. Yet Juliet, as Shakespeare wrote her, comes with some baggage, including the fact that by the sixth line of the prologue she’s dead.Undoing that fate became the musical’s animating principle and spine. In Read’s telling, Juliet (Lorna Courtney in a blow-you-away performance) doesn’t die but rather wakes up confused and a little emo following Romeo’s suicide. Cue “…Baby One More Time,” which she performs, still in her funeral dress but also sporting headphones and a Walkman, in front of her lover’s sarcophagus.That’s as grim as “& Juliet” gets — not very — because, as the erasure of Romeo from its title suggests, this girl is getting a glow-up. Here the show moves into meta territory, introducing Shakespeare’s wife, Anne Hathaway, as the force behind the revision. “I mean, what do I know,” Anne (Betsy Wolfe) slyly tells cocky Will (Stark Sands). “Maybe she doesn’t kill herself just because he killed himself?”When Will insists (to knowing chuckles) that he writes his plays completely by himself, Anne simply grabs the quill until he agrees to share authorship. To raise the meta ante, they also write themselves into the tale. “& Juliet” then proceeds to process the Shakespeares’s marital issues through Juliet’s new story, toggling between Anne’s feminist uplift and Will’s squirrelly, writerly (and perhaps patriarchal) need to complicate it.So when the scene shifts to Paris, where Anne provides Juliet with a new boy to enjoy, that boy — François du Bois (Philippe Arroyo) — turns out to have eyes for someone else, whom Will has contrived to throw in his path. The plot now twists its way through several typical Shakespearean tropes, including comic mismatches, reunited lovers (Paulo Szot and Melanie La Barrie) and the return of yet another character (I won’t spoil who, but you can probably guess) from the grave.Philippe Arroyo, left, as François and Justin David Sullivan as May in the musical.Sara Krulwich/The New York TimesThe songs that illustrate these developments — “Oops! … I Did It Again” when Juliet agrees to marry François, “Blow” for a big Paris ball — are mostly apt enough, though with nearly 30 of them squeezed into the show’s 150 minutes they eventually dig an aural rut. (The sound design by Gareth Owen doesn’t help, with its arena-style reverb in a relatively small theater.) And some have the tang of reverse engineering, as when Juliet’s nonbinary best friend, May, is given Spears’s “I’m Not a Girl, Not Yet a Woman.”Nevertheless, May (Justin David Sullivan) is a typically clever modern gloss on Shakespeare — a playwright, as Anne points out, who is “basically synonymous with gender-bending.” And if three of the couples, liberated by Juliet’s liberation, achieve surprisingly normative happy endings, the girl herself ends the show uncommitted, still trying to “own her choices,” apparently by not making any.Most of the comedy derives from similar tensions; though “& Juliet” is jokey, and its authorship is entirely male, its feminist critique is real enough, winking alternately at Shakespeare’s assumptions and ours. At one point, Anne summarily up-ages Juliet by about a decade because she’s “not going clubbing with a 13-year-old” — nor (it goes unsaid) letting a 13-year-old marry.Indeed, it’s Anne who provides most of the wit, not just verbal but philosophical. And it’s Wolfe’s performance — capped with a roof-raising rendition of the Celine Dion hit “That’s the Way It Is” — that gives the show its heart, an organ too often unheard from in musicals entirely focused on the ear.I could have used a bit more brain, though; “& Juliet” sometimes seems suspicious of its own intelligence, like a nerd invited to the cool kids’ party, only to get drunk and vomit in the pool.The overcompensation — two confetti explosions? — is unnecessary. Jukebox musicals may still be bottom feeders, but, as “& Juliet” proves, there are sometimes small treasures to be found in the murk. And as long as they’re going to keep arriving regardless, I have to admit (citing Martin’s hit for those theater critics the Backstreet Boys) I want it that way.& JulietAt the Stephen Sondheim Theater, Manhattan; andjulietbroadway.com. Running time: 2 hours 30 minutes. More