Attention deficit hyperactivity disorder (ADHD) is a prevalent neurodevelopmental disorder, and cognitive flexibility is a sub-component of executive functioning. Studies have shown impairments in cognitive flexibility in ADHD, which is affected by attentional processes. Personality, as a long-standing trait, has a profound effect on ADHD. However, previous studies have not assessed the relationship between attentional function, personality traits, and cognitive flexibility in children with ADHD. This study explored the association between attention networks, personality, and cognitive flexibility in ADHD, filling a gap in the related field. We expect our findings will provide insights into and clues for the prevention and interventional treatment of ADHD. This study primarily aimed to analyze differences in cognitive flexibility between individuals with ADHD and those without and further examine associations between attention networks, personality, and cognitive flexibility in children with ADHD. Overall, 55 children aged 7 to 11 years diagnosed with ADHD and 40 children without ADHD participated in this study. Cognitive flexibility, personality traits, and attentional networks were assessed using the Wisconsin Card Sorting Test, Eysenck Personality Questionnaire, and Attention Network Test, respectively. Additionally, the association between personality traits and strong attentional functioning and cognitive flexibility was investigated using multiple regression analysis. Children with ADHD had significant deficits in cognitive flexibility. A multiple regression analysis revealed that the alerting effect was highly associated with cognitive flexibility at high levels of neuroticism. This association was not salient in individuals with low levels of neuroticism. This study demonstrated that the ADHD group experienced lower cognitive flexibility than the control group. In addition, we showed the effect of neuroticism and alerting networks on cognitive flexibility. These findings may help psychiatrists provide intervention strategies to mitigate the impairment of social functioning in ADHD with cognitive spirituality deficits.