Lopez and Anthony, who were married in 2004, said they were "overwhelmed" by the welcome at P.S. 36 Unionport School in the New York City borough of the Bronx.
They are about to launch a musical tour to support a children's health campaign. It will be her first tour.
"We look at you and see ourselves," said the 39-year-old Lopez. "This is overwhelming. I remember being in school, being on stage and dreaming of great things."
"There's nothing in the world, no Grammy, no Oscar, that can make me feel more warm than today," said Anthony, 38, who recently released the soundtrack to "El Cantante," a biopic of salsa legend Hector Lavoe.
Part of the proceeds from the 19-concert tour, which kicks off Friday in Atlantic City, N.J., will go to schools with programs promoting physical education and a healthy lifestyle.