Pendant selenium‐containing maleimide polymers with different selenium contents are synthesized via a radical copolymerization of styrene and N‐butylmaleimide phenyl selenide. The polymer structures are characterized by nuclear magnetic resonance, gel permeation chromatography, Fourier transform infrared spectroscopy, ultraviolet–visible spectroscopy, and scanning electron microscopy with an energy‐dispersive spectrometer, which results in the desired structures and selenium contents. The refractive indices of the polymers, which change as a function of different contents of selenium and oxidative stimuli by H2O2 or O3, are investigated. Finally, a photonic crystal (PC) is prepared based on the selenium‐containing polymer. The visible color changes of the PC are investigated as a function of different concentrations and contact times of O3.