A shell of an electronic device includes a front cover, a rear cover, and a latching assembly. The front cover includes two first sidewalls. The rear cover includes two first borders. The latching assembly includes two first latching members, two spacers, and two groups of second latching members. The first latching members define a number of latch-receiving portions. The first latching members are fixed to the inner surface of first sidewall with a corresponding spacer intervened therebetween. The second latching member is mounted to the inner surface. Each of the second latching members includes a sliding pole and a cap. Each of the latch-receiving portion includes a sliding portion forming an entrance for a corresponding second latching member sliding into the latch-receiving portion, and a latching portion communicating with the sliding portion, which is an elongate slot parallel to the length direction of the first latching member.