A mounting mechanism adapted for mounting at least one first component to a second component includes a base, a movable member, and a transmission device. The base is mounted on the second component. The movable member is movably mounted on the base and includes a holding portion to which the at least one first component can be mounted. The transmission device is configured to displace the movable member from a first position to a second position in response to the least one first component being mounted to the holding portion of the movable member.