Okay, I figured it out. Tempted to just delete the thread out of embarrassment, but will keep it up as I imagine I'm not the only newbie that gets blindsided by this sort of thing...
In a nutshell, having come to event listeners fairly recently, I neglected to take into account that the script will run substantially faster than I can enter a name into the input field, and thus will run the console.log() much earlier than I can hope to run the event listener function to assign a value, regardless of where I type console.log()... Facepalm! Anyway, it looks like @JakeAve called it - and I'll definitely remember to use setTimeOut() to get round this sort of thing in the future, that's a neat strategy.
Thanks everyone for taking your time to help out - much appreciated!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…