Declare these in the global scope (outside of the functions/callback) and it should work:
const userInput = document.getElementById('user-input');
const checkBtn = document.getElementById('check-btn');
const resultsDiv = document.getElementById('results-div');