In order to realize the controlled release and limited toxicity of triclosan (TC), a degradable UV-crosslinked hydrogel was prepared. For this purpose, the acryloyl chloride-modified polyactide-poly(ethylene glycol)-polylactide block copolymer was firstly synthesized and then mixed with photoinitiator to form the hydrogel rapidly under a low-intensity UV light. The properties of hydrogel, such as hydrogel strength, swelling and degradation, had been studied. The results showed that the properties of hydrogel could be modulated by the concentration of copolymer. After the encapsulation of TC, the sustained-release capability and antibacterial effect of the obtained hydrogel were studied. It was found that the sustained release of TC could potentially reduce the side effects of TC. With controlled antibacterial activity, the use of TC would be safer and more efficient. Moreover, the biocompatibility of hydrogel was also evaluated by in vitroand in vivo assays, suggesting the great potential application in the delivery of TC. The novel aspects of this study include the cytotoxicity study and the in vitro and in vivoassays, which might be useful for other researchers in this field.