var sample1Btn = document.getElementById("sample1Btn"); sample1Btn.onclick = function(){ if(window.confirm("ページを開きますか?") == false){ location.href = "http://arise.work"; } }
var sample2Btn = document.getElementById("sample2Btn"); sample2Btn.onclick = function(){ if(confirm("本当にダウンロードしますか?")){ console.log("Downloading..."); } else { console.log("Not Download"); } }