User:TikTokToxi/CodeResort

var annotations = document.getElementsByClassName("annotated"); for (var i = 0, max = annotations.length; i < max; i++) { var tate = annotations[i].getAttribute("title") + ""; var cur = annotations[i]; annotations[i].setAttribute("data-annotation", tate); annotations[i].setAttribute("data-lyric", annotations[i].innerHTML); annotations[i].removeAttribute("title"); cur.addEventListener("click", function {       mw.notify(Convert(annotations[i].getAttribute("data-annotation")), { "title": annotations[i].getAttribute("data-lyric"), "tag": "tate" });   }) } function Convert(text) { return text; }