Addition of a photodegradable group to the backbone of synthetic hydrogels enables real-time control of the material's chemical and physical properties.