From 4887c6360922c44f24c46918efa256af8f2e9ddf Mon Sep 17 00:00:00 2001 From: Matteo Manzinello Date: Wed, 1 May 2019 00:27:08 +0200 Subject: [PATCH] commentata creazione dinamica html, prima versione con alert del browser --- src/mailgo.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mailgo.js b/src/mailgo.js index 1b4d5b5..4aa6fb1 100644 --- a/src/mailgo.js +++ b/src/mailgo.js @@ -5,17 +5,22 @@ console.log("mailgo is WIP"); // attivo mailgo su tutti gli elementi mailtos.forEach(mailto => { + /* var newDiv = document.createElement("div"); var newContent = document.createTextNode("hi!"); newDiv.appendChild(newContent); mailto.parentNode.insertBefore(newDiv, mailto.nextSibling); + */ mailto.addEventListener( "click", event => { event.preventDefault(); - alert("clicked"); + let r = confirm("You have clicked mailto: " + mailto.href); + if (r === true) { + location.href = mailto.href; + } }, false );