javascript: problem with splice method of array object
Hello,
I am having problems with the splice method of the array object
Code:
with getElementsByTagName, I am returning all img tags within a <div id="container">img, img, etc</div>
imgs = container.getElementsByTagName("img");
then i want to remove an element at some index
imgs.splice(indexToRemove,1);
I get an error saying that
"Object doesn't support this property or method"
However if i do it to an array strings it works
imgs = ["index1","index2","index3"];
alert("the length of imgs is now" + imgs.length);
imgs.splice(indexToRemove,1);
alert("the length of imgs is now" + imgs.length);
does this mean that splice cannot be used on an array of objects?
thank you
bsw