An electronic device, comprising: a housing, arranged with a mounting cavity and a mounting hole connected to the mounting cavity; a key, disposed in the mounting hole and configured to be movable relative to the housing when the key is pressed; a circuit board, mounted in the mounting cavity; a trigger structure, electrically connected to the circuit board; a detection electrode, disposed on a rear cover of the housing and exposed on a side of the rear cover; and an elastic member comprising a first connection and a second connection connected to the first connection, wherein the first connection is electrically connected to the circuit board; the second connection is abutted on the key; the key, the first connection, the second connection are conductive to each other and to the circuit board; the electronic device further comprises a biosensor electrically connected to and conductive to the key and the detection electrode; the electronic device is capable of being worn on a body of a user, and the body of the user is in contact with the detection electrode when the electronic device is worn; the biosensor is configured to measure an electrocardiogram data of the user, when the key and the detection electrode are in contact with the body of the user; wherein when the key is pressed, the elastic member is capable of generating two levels of deformation; during a first level of deformation, the first connection is deformed relative to the housing, and the first connection approaches the trigger structure; during a second level of deformation, the second connection is deformed relative to the first connection and switches from a state spaced apart from the trigger structure to a state in contact with the trigger structure. a housing, arranged with a mounting cavity and a mounting hole connected to the mounting cavity; a key, disposed in the mounting hole and configured to be movable relative to the housing when the key is pressed; a circuit board, mounted in the mounting cavity; a trigger structure, electrically connected to the circuit board; a detection electrode, disposed on a rear cover of the housing and exposed on a side of the rear cover; and an elastic member comprising a first connection and a second connection connected to the first connection, wherein the first connection is electrically connected to the circuit board; the second connection is abutted on the key; the key, the first connection, the second connection are conductive to each other and to the circuit board; the electronic device further comprises a biosensor electrically connected to and conductive to the key and the detection electrode; the electronic device is capable of being worn on a body of a user, and the body of the user is in contact with the detection electrode when the electronic device is worn; the biosensor is configured to measure an electrocardiogram data of the user, when the key and the detection electrode are in contact with the body of the user; wherein when the key is pressed, the elastic member is capable of generating two levels of deformation; during a first level of deformation, the first connection is deformed relative to the housing, and the first connection approaches the trigger structure; during a second level of deformation, the second connection is deformed relative to the first connection and switches from a state spaced apart from the trigger structure to a state in contact with the trigger structure.