'Scroll to End of Log' in output window

Naive implementation on vanilla-js.
Is there a reason why getElementById won't work here?