In the sentence "Why did you do that?", what part of speech is "why"?

What part of speech is a question word? Noun, verb, adjective... what?
1 answer 1