A windshield assembly includes a lower panel section pivotally connected to an upper panel section. The assembly is movable between an extended position, in which both sections are fully extended and substantially co-planar, and a pivoted position, in which the upper section is pivoted down to rest on top of the lower section. A pair of magnets are positioned on the upper section proximate the top edge of the upper section, and a second pair of complementary magnets or members made of a material that is magnetically attracted to the first pair of magnets are positioned on the lower section proximate the bottom edge of the lower section. When in the pivoted position, the magnets on the upper section engage the lower section magnets, thereby keeping the upper section secured on the lower section and preventing unwanted movement of the upper section as the golf car travels.