Electronic magnetic switches with magnetoresistive elements or Hall elements detect an actuating magnet without contact. The electronic versions are characterized by extreme insensitivity to vibration, shock or impact as well as long switching distances.