functiondisplaycitations () {//get all references varQuotes = document.getElementsByTagName ("blockquote"); //Traversal Reference for(vari=0; i<quotes.length; i++){ //If there is no cite property, continue looping if(!quotes[i].getattribute ("cite"))Continue; //Save cite property varurl = quotes[i].getattribute ("cite"); //gets all the element nodes in the reference varQuotechildren = Quotes[i].getelementsbytagname ("*"); //If there are no element nodes, continue looping if(Quotechildren.length < 1)Continue; //gets the last element node in the reference varElem = quotechildren[quotechildren.length-1]; //Create tags varlink = document.createelement ("a"); varLink_text = document.createTextNode ("source"); Link.appendchild (Link_text); varSuperscript = document.createelement ("Sup"); Superscript.appendchild (link); //adds a tag to the last element node in the reference;elem.appendchild (superscript); }} addloadevent (displaycitations);
JS DOM Programming Art--Show Source link Table--js Study note 2015-7-17 (86th Day)