//License: MIT //Chrisoft Xiong 2017 var starting=0; function footnoter() { var footnotes=document.body.getElementsByTagName("footnote"); for(var i=0;i<footnotes.length;++i) { var s=footnotes[i].innerHTML; footnotes[i].innerHTML="";//IE is stupid var a=document.createElement("a"); a.setAttribute("id","n"+(starting+i+1)); a.setAttribute("href","#note"+(starting+i+1)); a.setAttribute("class","note"); a.innerHTML="["+(starting+i+1)+"]"; footnotes[i].parentNode.insertBefore(a,footnotes[i]); var span=document.createElement("span"); span.setAttribute("class","TText"); span.innerHTML="<a id=\"note"+(starting+i+1)+"\" href=\"#n"+(starting+i+1)+"\">["+(starting+i+1)+"]</a>: "+s+"<br>"; document.getElementById("notediv").appendChild(span); } starting+=footnotes.length; while(footnotes.length)footnotes[0].remove(); }