I think, you are not in context of unitConvert variable, when event get's called.
Moover, From code it looks
fromLength
is some global variable, at least I do not see it's initialization
addEvent(fromLength, 'change', unitConvert.unitLength);
As this is global variable, your code works fine
console.log(fromLength.value);
.