An (acid-substituted polyaniline)-grafted hydrogel copolymer is provided. The (acid-substituted polyaniline)-grafted hydrogel copolymer has a general formula as below:The A is a proton acid group. The (acid-substituted polyaniline)-grafted hydrogel copolymer is formed by the polymerization and substitution reaction between chitosan, polyaniline, and proton acid. The (acid-substituted polyaniline)-grafted hydrogel copolymer behaves as a pH-responsive hydrogel with photo-thermal properties and can be applied to photo-thermal therapy.