Do I need to connect ground when installing a lighted switch?

I bought a lighted switch to replace a plain one in my hallway. When I went to pull the old one out, there are only a red wire and a black wire... the ground is capped off. Is it ok to just put red and black into the lighted switch when I install this new one?
2 answers 2