Since the isn't an tag (or other form input like ), it will not have a .val() (value). Instead, you need either .html() or .text():
var spanishWord = $("#randomWordToTranslate");
var inputValue = spanishWord.text();
// Or:
var inputValue = spanishWord.html();