Edit: sorry guys i dont need the answer anymore
getElementsByTagName() is a live HTMLCollection, so when you call c.remove(), the length of t becomes 1. You can circumvent this by caching t.length:
var tLen = t.length;
for (v i = 0; i < tLen; i++) {
It looks like you are trying to use .length to loop though an object, when .length only works on arrays.
getElementsByTagName() returns a object, not an array and Array.prototype.length only works on arrays.
I found a other post about getting an array of getElementsByTagName(): Link