A dustproof structure for a laptop includes a gate, a motor and a controller. The laptop includes a shell having an air vent defined therein. The gate is movably mounted on the shell. The motor is mounted on the shell and connected to the gate. The controller is installed inside the laptop and configured for controlling the motor to drive the gate to open the air vent of the shell when the laptop is powered on, and to close the air vent of the shell when the laptop is being powered off.