Emotion recognition based on electroencephalography (EEG) has demonstrated promising effectiveness in recent years. However, challenges have been experienced, such as limited dataset availability, experimental protocol inconsistencies, and inherent spatiotemporal redundancies in the EEG data. In this work, we introduce a novel method of contrastive learning of EEG representation of brain area (CLRA). Our method is based on the fact that the EEG signals are of high similarity within brain regions and show significant differences between brain regions. The model is designed to obtain the representation capable of distinguishing signals from different brain areas. Specifically, a 1-D convolutional neural network (CNN) and a recurrent network were applied to learn temporal representations from channelwise EEG in contrastive learning. The representations were recombined and fused to extract features for emotion classification. Experimental evaluations performed on public database for emotion analysis using physiological signals (DEAP) and Shanghai Jiao Tong University emotion EEG dataset (SEED) demonstrate the efficacy of our proposed framework, yielding state-of-the-art results in EEG-based emotion recognition tasks. In our cross-subject experiment, our method achieved an accuracy of 95.23% and 96.31% in valence and arousal on the DEAP, and an accuracy of 95.16% on SEED. Additionally, our experiments involving reduced channel configurations demonstrated an improvement in classification accuracy even with fewer electrodes. Furthermore, CLRA exhibits strong generalization performance and robustness, facilitated by its ability to extract informative single-channel features, thus enabling seamless cross-dataset integration and training.