An electronic device includes a chassis and a heat dissipation apparatus. The chassis includes a sidewall defining a latching hole and a rear wall defining an opening adjacent to the latching hole. The heat dissipation apparatus is detachably inserted in the chassis from the opening. The heat dissipation apparatus includes a casing defining a positioning slot aligning with the latching hole of the chassis, a liquid cooling assembly received in the casing, and a resilient latching member. A first end of the latching member is mounted in the casing. A latching block protrudes out from a second end of the latching member. The latching block extends through the positioning slot, to be latched in the latching hole of the chassis.