function hidestory (ev, el, id) {
for (var i=0; i < 3; i++) {
That 3 there is the problem with “simple” JS. It’s tightly coupled to the HTML but they live in completely different places.On a side note this 3 should be at least assigned to a variable with a meaningful name.