A foldable electronic device includes a base member, a latch member movably mounted to the base member, a resilient member, and a top member. The latch member includes a locking portion. The resilient member is mounted between the latch member and the base member. The top member has a shaft member pivotably mounted thereto. The shaft member includes a locking post. The locking post defines a locking slot therein, for receiving the locking portion of the latch member.