To evaluate the associations between traffic-related air pollution (TRAP) and children's attention spans, an analysis was performed in a cross-sectional epidemiological study. Two primary schools were chosen based on the levels of traffic density and ambient air pollutants. School A is located in a clean area and School B in a polluted area. Two-hundred and eighty-two students from three third-grade classes (9-10 years of age) (School A, 136; School B, 146) participated in five computerized-based neurobehavioral tests. Neurobehavioral test results were used as the independent variables for component extraction by factor analysis, and two main compositions -visual memory factor and attention factor -were extracted. After controlling the potential confounding factors, we found that children from School B at the polluted area had lower scores of attention factor than those from School A in the clean area (β = -0.300, p = 0.016), and girls obtained higher scores than boys (β = 0.317, p = 0.011). In conclusion, exposure to TRAP was significantly associated with decreased attention score of school-aged urban children, and the association was significantly more evident in boys than girls.