R. Joshua asked the students what R. Elazar b. Azaf yah taught. They replied that he taught that all without exception must attend school and service, for all that would attend would be rewarded; the men and women for attending and the children for those who brought them.
Why Even the Children Come to the Synagogue
Chagigah 3a; Gaster, Exempla No. 168