A button assembly applied on an electronic device is provided. An electronic device includes a housing and a button assembly. The housing defines two through holes and includes a first latching member. The button assembly includes a button body and a sealing frame. The button body includes two keycaps and a waterproof layer. Each of the keycaps extends through one of the through holes and is external to the housing. The waterproof layer is made of elastic waterproof material. The sealing frame includes a second latching member and is fixed to the housing. The waterproof layer corresponding to the first latching member and the second latching member is deformed, which creates waterproof seal.