I'm attempting to use the window.open command to open a new tab with the input given by the user. I'm having trouble getting it to work, Here's my code:
const myButton = document.getElementById('add')
myButton.addEventListener('click', function(event2) {
window.open('link');
})
<input id="link" />
<button id="add">Add</button>