If you mean surface electrodes, then that is EEG: ElectroEncephaloGram. If you mean electrodes inside the brain, then you're talking brain surgery. I'm not sure what point you're making here - could you elucidate?
I did mean electrodes in the brain (or spine) and mentioned that for completeness, to make it clear there's another method besides fMRI and EEG. Which indeed has the obvious disadvantage it involves some surgery, but does the type of signal recorded with it does have advantges over the other methods.
Or neural recordings with electrodes. Better spatial resolution than EEG and fMRI and way better time resolution than fMRI.