JSFiddle - React, Tailwind, and code Playground
HTML
Type the youtube code and click Open!
<div id="links">
</div>
<input type='text' id='userInput' value='' />
<input type='submit' onclick='changeText2()' value='Open'/>
<script>
var links = [
"http://music-dump.com/id/00000",
"http://youtube-id.com/download/00000",
"http://example.com/v/00000"
];
function changeText2() {
var userInput = document.getElementById('userInput').value;
links.forEach(function(link) {
link = link.replace("00000", userInput);
var a = document.createElement("a");
a.href = link;
a.innerHTML = link;
document.getElementById('links').appendChild(a);
});
}
</script>
CSS
a {
display: block;
}