The present invention discloses a connector connecting a main board and a sub board. The connector includes a {irst connecting portion and a second connecting portion. The first connecting portion includes a plurality of terminals and a latching arm. The latching arm forms a connection end. The second connecting portion includes a pluraliry of terminal slots and an engaging groove. The engaging groove can be coupled to the connection end ofthe first connecting portion. The first connecting portion can be coupled to the second connecting portion at a first angle, such that the terminals are electrically connected to the terminal slots and the connecting ends are fastened to the engaging arms, and the terminals are electrically connected to the terminal slots. In a state in which the electrical connection is maintained, the first connecting portion and the second connecting portion are disposed in close to or in the same plane by applying an extemal force to change the first angle between the first connecting portion and the second connecting portion to the second angle.