A portable electronic device includes a main casing having a battery-receiving groove for receiving a battery therein, and two aligned resilient abutting tongues flanking the battery-receiving groove. A cover is mounted removably on the main casing for covering the battery-receiving groove. Two anchoring members are mounted rotatably on the cover, extends into the main casing, and is operable so as to switch between a releasing state, where the abutting tongues are spaced respectively apart from the battery, and a clamping state, where the abutting tongues are pressed respectively against the battery.