I dynamically create a link to a. 'mywebsite' is a variable. Everything works but the mywebsite page replaces that of the code. I want to open mywebsite in another page. May I have a help to solve the problem ?
var mylink = document.createElement("a");
var textForButton = document.createTextNode("More details");
mylink.appendChild(textForButton);
mylink.setAttribute("href", mywebsite);
document.body.appendChild(mylink);