Electromagnets are a different from permanent magnets. Electromagnets are made of coils of wire with electricity passing through them. Moving charges create magnetic fields, so when the coils of wire in an electromagnet have an electric current passing through them, the coils behave like a magnet. When the electricity stops flowing, the coils don’t act like a magnet anymore. Electromagnets are used in a lot of electronic devices when magnetic forces are only needed for short periods of time.