Hint box generator in JavaScript