Random Word Generator with respective link using js

hi friends,
It's a js question. However i feel , here is the best place to ask.
A user in reddit asked question related to Random Word Generator with respective link using js random word generator - HTML - OneCompiler. In the given link random generator working perfectly . After reading the code , i got interested and wanted to do on my own with self interest.
Aim: After clicking generate button . some random words will display. For example , After clicking generate button if the word displays "google". Then near to the word google, with some space, a hyperlink with name "Link" should appear and when we click that "Link", it should goto google.com
however i am not able to do as per the question.
So far i created two codes which will display the full url but not like as mentioned in "Aim".friends