A new kind of polymer surfactant, noncovalent binding between N,N‐dimethyl‐dodecylamine and alginate (C12A‐Alg), was successfully prepared by mixing N,N‐dimethyl‐dodecylamine (C12A) and sodium alginate (NaAlg) in the appropriate mole ratio and bubbling CO2. C12A was successfully grafted onto the alginate molecule by electrostatic interaction. The structure of C12A‐Alg was confirmed by Fourier transform infrared and NMR spectroscopies. The polymer surfactant C12A‐Alg has superior performance in foamability and emulsification. This foaming/defoaming and emulsification/demulsification behavior can be triggered by bubbling CO2/N2, demonstrating that the polymer surfactant C12A‐Alg is switchable. © 2018 Society of Chemical Industry