Among the A/B stars, about 5% host large-scale organised magnetic fields. These magnetic stars show also abundance anomalies in their spectra, and are therefore called the magnetic Ap/Bp stars. Most of these stars are also slow rotators compared to the normal A and B stars.
Today, one of the greatest challenges concerning the Ap/Bp stars is to understand the origin of their slow rotation and their magnetic fields. The favoured hypothesis for the latter is that the fields are fosils, which implies that the magnetic fields subsist throughout the different evolutionary phases, and in particular during the pre-main sequence phase. The existence of magnetic fields at the pre-main sequence phase is also required to explain the slow rotation of Ap/Bp stars.
During the last 3 years we performed a spectropolarimetric survey of the Herbig Ae/Be stars in the field and in young clusters, in order to investigate their magnetism and rotation. These investigations have resulted in the detection and/or confirmation of magnetic fields in 8 Herbig Ae/Be stars, ranging in mass from 2 to nearly 15 solar masses. In this paper I will present the results of our survey, as well as their implications for the origin and evolution of the magnetic fields and rotation of the A and B stars.