Enter original link here: Enter original link here for TINYURL: Output: output function copy() { setTimeout(function() { console.log('called'); var copyText = document.getElementById("myInput").value; copyText = 'https://storehaccounts.blogspot.com/p/download-terminal.html#' + btoa(copyText); // Copy the text inside the text field navigator.clipboard.writeText(copyText); document.querySelector('#output').innerText = copyText; document.querySelector('#output').href = copyText; }, 100); } function copyA() { setTimeout(function() { console.log('called'); var copyText = document.getElementById("myInput").value; copyText = 'https://storehaccounts.blogspot.com/p/link-terminal-station-2.html#' + btoa(copyText); // Copy the text inside the text field navigator.clipboard.writeText(copyText); document.querySelector('#output').innerText = copyText; document.querySelector('#output').href = copyText; }, 100); } function copyB() { setTimeout(function() { console.log('called'); var copyText = document.getElementById("myInput").value; copyText = 'https://storehaccounts.blogspot.com/p/link-terminal-station-3.html#' + btoa(copyText); // Copy the text inside the text field navigator.clipboard.writeText(copyText); document.querySelector('#output').innerText = copyText; document.querySelector('#output').href = copyText; }, 100); } function short() { setTimeout(function() { $.get("https://tinyurl.com/api-create.php?url=" + encodeURIComponent(document.getElementById("myInput2").value), function(shorturl){ navigator.clipboard.writeText(shorturl); document.querySelector('#output').innerText = shorturl; document.querySelector('#output').href = shorturl; }); }, 100); }