Mary Shelley's 1818 novel Frankenstein is more than a literary work of the early 19th century--it also represents the scientific discoveries and enthusiasms of her time for electricity.
"I succeeded in discovering the cause of the generation and life; nay, more, I became myself capable of bestowing animation on life matter." --Victor Frankenstein
In Frankenstein, electricity is seen as the secret of life, able to give life to the lifeless. Shelley merely reflected a belief that was becoming increasingly popular in American and European culture. In her novel, Victor Frankenstein alludes to lightning and to Galvanism as the basis for reanimating a lifeless cadaver. Luigi Galvani had popularized the idea of electricity as an innate force of life, what he called animal electricity. Galvani's ideas had largely been supplanted in the scientific community by the time of Shelley, but the idea of an internal electrical fire and particularly reanimation remained strong in the public imagination.
Shelley herself mentioned discussing many of the electrical experiments going on in Europe and the United States with her husband, Percy Shelley, and Lord Byron. They, like the rest of the public, were especially intrigued with the idea of reanimating the dead. These discussions led Shelley to explore the moral and personal responsibilities of scientific advances in her own writing. She recognizes science as a powerful force but one capable of great harm if left uncontrolled. Victor Frankenstein uses science to create his monster yet it ultimately leads to his demise.
Interestingly, Shelley does not provide much description of the laboratory or the way in which Frankenstein is created. Only two sentences in the book mention lightning and Galvanism, though, spectacular electrical displays with shooting lightning bolts became the standard means for depicting the act of creation in movies.