Purpose: Physical education is an important way to improve the sports skills and physical health level of Chinese junior middle school students, help students master sports health knowledge, and cultivate students' sports behavior. It is of great significance to improve the teaching quality of physical education class and solve the practical problem that students like physical education but don't enjoy having physical education class by improving students' expectancy-value of physical education class and correcting students' attitude toward PE (physical education) class. Therefore, to explore the differences between the expectancy-value and attitude of different types of students participating in physical education class, and to clarify the impact of the expectancy-value of different types of students on their attitude toward PE class, can provide a reference for the classified optimization of the expectancy-value and attitude of junior high school students in physical education. Methods: A questionnaire was collected from 2809 Chinese junior middle school students, with an average age of 13.37 years. Among them, 1397 boys and 1412 girls; There are 1010 students in urban schools and 1799 students in rural schools. The contents of the survey include students' age, gender, grade, school type (urban or rural) and other demographic variables, as well as students' expectancy-value and attitude towards PE. The expected value was measured by the Expectancy Value Questionnaire, which includes two dimensions: expectancy beliefs for success and perceived task values (attainment value, intrinsic/interest value, utility value). The construct validity of the questionnaire exceeds 0.90. The attitude toward PE class was measured by the Attitude toward Physical Education Questionnaire for Middle School Students, which includes two dimensions: affective component (α=. 89) and cognitive component (α= .86). Using SPSS 25.0 software, using ANOVA, correlation analysis and regression analysis and other statistical analysis methods, this paper analyzes the differences and effects of different types of junior high school students' expectancy-value on their attitude towards PE class, as well as the moderating effects of demographic variables. Results: (1) The total score of expectancy-value (F=82.45, p < 0.001), total score of attitude toward PE class (F=93.43, p < 0.001) and scores of each dimension of junior middle school boys were significantly higher than those of girls; (2) The scores of rural students' expectancy beliefs for success (F=4.84, p < 0.05), perceived task values (F=7.01, p < 0.01), and affective component of attitude toward PE class (F=5.05, p < 0.05) were significantly higher than those of urban students; (3) There are significant differences in the total score of the expectancy-value (F=8.24, p < 0.001), the score of the expectancy beliefs for success (F=13.74, p < 0.001), the score of the perceived task values (F=8.35, p < 0.001), the total score of the attitude towards PE class (F=5.64, p < 0.01), and the score of the affective component (F=8.04, p <0.001) of the students in Grade one, Grade two, and Grade three. (4) The expectancy-value of physical education of junior high school students can significantly predict their attitudes towards PE class, which is mainly reflected in the predictive effect of perceived task values on the affective component and cognitive component of attitude toward PE class and are moderated by school type (B=0.11, p < 0.01) and grade (B=0.09, p < 0.05). Conclusion: (1) The expectancy-value and attitude toward PE class of junior middle school boys are better than that of girls, the expectancy-value and attitude toward PE class of rural school students are better than those of urban school students, and the expectancy-value and attitude toward PE class of students in grade three are better than those in grade one and grade two; (2) The perceived task values of junior high school students has a predictive effect on the affective and cognitive component of the attitude towards PE class, and are positively moderated by the school type and grade.