An electronic cigarette capable of protecting the functional element on the surface of the main body of the electronic cigarette is provided. The main body of the electronic cigarette is provided with a functional element, a protection mechanism and a magnetic locating member; the protection mechanism is slidably connected to the main body of the electronic cigarette and is configured to cover the functional element; and the magnetic locating member is connected to the protection mechanism magnetically, and is configured to prevent the protection mechanism from randomly sliding on the main body of the electronic cigarette in a case that the functional element is exposed or covered by the protection mechanism. The present application avoids the exposure of the functional element, which prevents the functional element from being touched by mistake when the electronic cigarette is carried by the user, and allows the electronic cigarette to operate normally.