A fastener includes a fastening element, a fixture, and a spring. The fastening element includes a pole portion, a head portion extending from an end of the pole portion, and an engaging portion extending from another opposite end of the pole portion. The pole portion forms a flange on a periphery thereof. Blocks protrude outwardly from a periphery of the head portion. The fixture defines cutouts and buckling grooves therein, corresponding to the blocks of the fastening element. The blocks extend through the cutouts of the fixture and are rotated by an angle to be buckled in the buckling grooves. The spring circles the fastening element and is compressed between the flange and the fixture.