Skip to content

Instantly share code, notes, and snippets.

@thephw
Last active August 29, 2015 14:21
Show Gist options
  • Save thephw/edb321a5542923e17ce4 to your computer and use it in GitHub Desktop.
Save thephw/edb321a5542923e17ce4 to your computer and use it in GitHub Desktop.
ul{
list-style-type:none;
counter-reset: section;
}
li:before {
counter-increment: section;
content: counter(section);
}
li:nth-child(3n):before, li:nth-child(5n):before{
content: "";
}
li:nth-child(3n):before{
content:"Fizz";
}
li:nth-child(5n):after{
content:"Buzz";
}
ul = document.createElement("ul")
for(i = 1; i <= 100; i++){
li = document.createElement("li")
ul.appendChild(li)
}
document.getElementsByTagName('body')[0].appendChild(ul)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment