before vowels electr-, word-forming element meaning "electrical, electricity," Latinized form of Greek ēlektro-, combining form of ēlektron "amber" (see electric). As a stand-alone, formerly often short for electrotype, electroplate.
1610s, "the characteristic properties of a magnet," from Modern Latin magnetismus (see magnet + -ism). Figurative sense of "personal charm, attractive power or influence" is from 1650s; in the hypnotic sense it is from Mesmer (see mesmerism). Meaning "science of magnets and magnetic phenomena" is by early 19c.
<a href="https://www.etymonline.com/word/electromagnetism">Etymology of electromagnetism by etymonline</a>
Harper, D. (n.d.). Etymology of electromagnetism. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/electromagnetism