Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
//Have to create a closure and redefine "i" inside so that the console won't throw undefined error
var index = i;
var elem = document.getElementsByClassName('cat');
array[index].count = array[index].count + 1;
var total= array[index].count;
var numb = document.getElementsByTagName("p")[index];
numb.innerHTML = total;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.