A mounting apparatus includes a support member, a sliding member, a spring member, and a cover. The support member is configured for maintaining an electronic device thereon. The sliding member is configured for being secured on a display. A retaining portion is located on the sliding member and defines a through hole. A spring member is secured on the support member and engages the through hole of the sliding member. A cover is secured on the support member to position the sliding member between the support member and the cover. The sliding member is slidable relative to the support member and the spring member, and the retaining portion resiliently deforms the spring member.