Attention is the foundation of a person's cognitive function. The attention level can be measured and quantified from the electroencephalogram (EEG). For the study of attention detection and quantification, we researchers usually ask the subjects to perform a cognitive test with distinct attentional and inattentional mental states. Different attention tasks are available in the literature, but there is no empirical evaluation to quantitatively compare the attention detection performance among the tasks. We designed an experiment with three typical cognitive tests: Stroop, Eriksen Flanker, and Psychomotor Vigilance Task (PVT), which are arranged in a random order in multiple trials. Data were collected from ten subjects. We used six standard band power features to classify the attention levels in four evaluation scenarios for both subject-specific and subject-independent cases. With cross-validation for the subject-independent case, we achieved a classification accuracy of 61.6%, 63.7% and 65.9% for PVT, Stroop and Flanker tasks respectively. We achieved the highest accuracy of 74.1% and 65.9% for the Flanker test in the subject-dependent and subject-independent cases respectively. Our evaluation shows no statistically significant differences in classification accuracy among the three distinct cognitive tasks. Our study highlights that EEG-based attention recognition can generalize across subjects and cognitive tasks.