var dLabel = document.getElementById("dLabel");
dLabel.addEventListener('click', function (event) {
var pageUrl = window.location.href;
var copyTextarea = document.getElementById("pageUrlInput");
copyTextarea.value = pageUrl;
$("#copyInput").css({ "display": "" });
copyTextarea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Copying text command was ' + msg);
} catch (err) {
console.log('Oops, unable to copy');
}
});