Despite the increasing popularity of online learning in elementary and primary schools, it is unclear to which extent that students' attitudes toward online learning influence their learning progress and outcomes. In this study, the Online Learning Attitude Questionnaire (OLAQ) was developed and validated to measure students' online learning attitudes among 383 caregivers and 172 primary school students in Hong Kong. The caregiver data were analysed using exploratory and confirmatory factor analysis, and reliability analysis to establish the factor structure, reliability. and discriminant validity of the OLAQ questionnaire. The student data were analyzed using confirmatory factor analysis and reliability analysis to cross-validate the factor structure and confirm the reliability and discriminant validity of the OLAQ. The final 34-item OLAQ questionnaire comprises five subscales including (1) enjoyment, (2) development, (3) motivation, (4) utilization, and (5) anxiety. These results indicate that the OLAQ is a valid and reliable instrument for assessing primary school students' attitudes toward online learning. Copyright © 2023 Taylor & Francis.