JSFiddle - React, Tailwind, and code Playground
by techiedelight
HTML
<!doctype html>
<html lang="en">
<body>
<div id="container"></div>
<div>
<button id="generate">Generate Hyperlink</button>
</div>
</body>
</html>
CSS
button {
font-size: 14px;
margin: 8px;
padding: 3px;
}
JavaScript
document.getElementById('generate').onclick = function() {
var a = document.createElement('a');
a.target = '_blank';
a.href = 'https://www.techiedelight.com/';
a.innerText = 'Techie Delight';
var container = document.getElementById('container');
container.appendChild(a);
container.appendChild(document.createElement('br'));
}