A latch mechanism includes a bracket, a sliding element slidably located on the bracket, a latch portion fixedly connected to the sliding element, an elastic element connected to the bracket and the sliding element, and a trigger element including an elongated frame, a through hole and a pressed portion. The elongated frame is slidably located on the bracket, the through hole is formed on one surface of the elongated frame, and the pressed portion is disposed on the one surface of the elongated frame, and directly pressed by the latch portion. When the trigger element is pushed until the through hole is moved to the latch portion, the first elastic element moves the latch portion to extend into the through hole.