Created
October 14, 2014 13:56
-
-
Save user19/c6b13dc92c50ae0bafcc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var subscriberElement = document.getElementById('c4-primary-header-contents').getElementsByClassName('yt-subscription-button-subscriber-count-branded-horizontal yt-uix-tooltip')[0]; | |
var i = another = Number(subscriberElement.innerHTML.replace(",","")); | |
var count = setInterval(function(){ | |
counter(i); | |
i += 9; | |
if(i >= another+10000){ | |
clearInterval(count); | |
} | |
},10); | |
function counter(num){ | |
subscriberElement.innerHTML = String(num).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,'$1,'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment