I have an html page that I run locally in the web browser, and in the code I have a series of links. The links are wrapped around buttons, and the buttons are styled using CSS. I frequently have to add links, so I would like to put a "new link creator" directly on the page and create a button based on a url entered into the box. Here are some of the links and the code around them:
<div class='m'>
<a href='https://stackoverflow.com/' target='_blank'><input type='button' class='menu' value='Stack Overflow'></a>
<a href='https://puzzling.stackexchange.com/' target='_blank'><input type='button' class='menu' value='Puzzling Stack Exchange'></a>
<a href='https://pastebin.com/' target='_blank'><input type='button' class='menu' value='Pastebin'></a>
<a href='https://github.com/' target='_blank'><input type='button' class='menu' value='GitHub'></a>
<a href='https://scholar.google.com/' target='_blank'><input type='button' class='menu' value='Google Scholar'></a>
<a href='https://google.com/' target='_blank'><input type='button' class='menu' value='Google'></a>
<a href='https://encrypted.google.com/' target='_blank'><input type='button' class='menu' value='Encrypted Google'></a>
</div>
And here is the progress I've made so far on solving the problem (basically nothing):
<div class='tb'>
<input type='text' id='get_url'></input>
<input type='button' value='Create New Button' onclick='newbutton();'></input>
</div>
Which points to this JS:
function newbutton() {
var url = document.getElementById('get_url');
// ... make button with the given url
}
any help is appreciated. if I need to include any more code (e.g. my CSS) just let me know in the comments.