Created
May 22, 2016 10:15
-
-
Save anonymous/c2f2fabdde2ea14c71e4dd87ed1952f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addLink(){ | |
var liElements = document.getElementsByClassName("view") | |
var link = document.createElement ('a'); | |
for (var i = 0; i < liElements.length; i++){ | |
link.setAttribute('href',"#" + liElements[i].innerHTML); | |
liElements[i].appendChild(link); | |
console.log(liElements[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment