JSFiddle - React, Tailwind, and code Playground
HTML
<h1>Link to favorite site.</h1>
<h2>This is my favorite web site: <span id='link'></span></h2>
JavaScript
//Get the text you want to display
var text = document.createTextNode(prompt ("What is your favorite web site?"));
//Create an attribute to for the href
var href = document.createAttribute("href");
href.value = prompt ("What is the URL of that site?")
//Create a link
var link = document.createElement('a');
//Add the attribute to the link
link.setAttributeNode(href);
//Add the text to the link
link.appendChild(text);
//Add the link to the page
document.getElementById('link').appendChild(link);