The reversible addition-fragmentation chain transfer polymerization (RAFT) is an effective method to control chain growth and regulate active centers in functional materials.Herein, a novel antibacterial material, polymer cations-adjustable porous materials (PCaPM), was successfully synthesized by RAFT and quaternization. First, using 2-(dodecylsulfanylthiocarbonylsulfanyl)-2-methylpropionic acid as the chain transfer agent of RAFT, methyl methacrylate and 2-(dimethylamino)ethyl methacrylate as comonomers, and ethylene dimethacrylate as crosslinking agent, the light-yellow crosslinked block copolymer (PM-PDE), was synthesized by RAFT polymerization. Second, a series of porous materials (PCaPM) were obtained by quaternization of PM-PDE with alternative alkyl halide and swelling effects in water. The composition and structure of PM-PDE and PCaPM were characterized by scanning electron microscope, energy dispersive spectrometer, Fourier transform infrared spectra, 1 H-NMR, Brunauer-Emmett-Teller, and X-ray photoelectron spectroscopy. Their antibacterial properties were also evaluated against Staphylococcus aureus, Escherichia coli, and Valsa mali. Remarkably, PCaPM, containing tertiary amine and possessing high porosity and large specific surface area, presented excellent antibacterial activity. Hence, the resultant PCaPM exhibited excellent antibacterial activity due to the quaternary ammonium salts groups, which has great prospects in application in medical treatment, agricultural antibiotic, emulator, and sewage treatment.