A portable electronic device includes a mainframe computer, a sliding cover and an electrically-controlled driving device. The mainframe computer includes a base, a receiving recess formed on the base, and a plurality of vent holes which are evenly distributed on the base. The sliding cover slidably covers the receiving recess and the vent holes. The electrically-controlled driving device includes an electric motor and a linkage set. The linkage set is connected to the electric motor and the sliding cover for moving the sliding cover with the electric motor, so that the sliding cover is allowed to cover the vent holes and expose the vent holes from the base.