Microplastics and nanoplastics are emerging contaminants that pose a threat to the environment and human. Spectroscopic technologies are advantageous in analyzing nanoplastics, but it is challenging to selectively detect nanoplastics with different size thresholds. In this work, the hyphenated method of electrosorption and surface-enhanced Raman spectroscopy (ES-SERS) was developed for the simple, rapid, and size-resolved analysis of trace polystyrene (PS) nanoplastics from 20 to 300 nm. A rough silver was used as both the working electrode for electrosorption and the substrate for the SERS response. By applying a positive electric potential to the rough silver, the PS nanoplastics accelerated toward the silver surface and were adsorbed tightly at the SERS "hot spot" inside the rough silver nanostructure. The proposed ES-SERS method achieved a detection limit of 100 ng/L for 300 and 100 nm PS, 50 ng/L for 50 nm PS, and 30 ng/L for 20 nm PS nanoplastics. It is worth noting that smaller nanoplastics typically exhibit larger analytical enhancement factor values in ES-SERS. According to the difference in electromigration behavior of PS in various sizes, PS nanoplastics under a certain size can be selectively enriched and detected by controlling the electrosorption time. The ES-SERS method was successfully demonstrated for detecting nanoplastics released from the lids of disposable beverage cups. This work opens up new possibilities for size-resolved analysis of nanoplastics.