How to remove an item from HTMLCollection?
<p>I have some Javascript code to remove an item from a HTMLCollection as in code below. I get an error when splice is called that says: <code>allInputs.splice is not a function</code>. I need to remove items from HTMLCollection if the element type is not of button type.</p>

<p><strong>Question</strong> : How would I remove an item from such a collection? </p>

<p>I could transfer undeleted items to an array and then I could work with the array instead of original HTMLCollection but not sure if there is any other shorter way of doing this.</p>

<p><strong>JavaScript code</strong></p>

<pre><code>    var allInputs = contentElement.getElementsByTagName('input');
    for (var i = (allInputs.length - 1) ; i &gt;= 0; i--) {
        if (allInputs[i].type !== "button") {
            allInputs.splice(i, 1);//this is throwing an error since splice is not defined
        }
    }
</code></pre>