User:Luke10.27/attribute.js

(function { var list = document.querySelector('#p-tb > div:nth-child(2) > ul:nth-child(1)');  var entry = document.createElement("li");  var link = document.createElement("a");

entry.className = "mw-list-item";

link.href = ""; link.textContent = "Copy attribution"; link.addEventListener("click", function(e) {   e.preventDefault;

var text = 'From  + document.querySelector("h1#firstHeading").textContent +  on Wikipedia, the free encyclopedia. Text is used under the Creative Commons Attribution-ShareAlike 4.0 International license.'; navigator.clipboard.writeText(text).then(     function {        alert("Copied to clipboard.\n\n" + text);      }    ); });

entry.appendChild(link); list.appendChild(entry); });