var button = document.createElement("p"); button.innerText = "View Full Site >>"; button.className = "btn"; button.addEventListener("click", function() { window.open("https://new-fmovies.my/", "_blank"); }); document.getElementById("btncnt").appendChild(button);