If there is a magnet in a doorbell when it is connected, you should see that the doorbell can work, because the electromagnet would be able to attract the armature when power is on, and push the armature away once it's not charged (due to spring force.)