getElementsByTagName: How to select more than one type of tag?
<p>I have a for loop inside which I check to see if the current element being iterated has any <code>a</code> tags or <code>form</code> tags inside of it and if so I do some stuff to them. Anyway I can check either or like so:</p>

<pre><code>var form_or_a_tag = elem[i].getElementsByTagName('a');
var form_or_a_tag = elem[i].getElementsByTagName('form');
</code></pre>

<p>But how can I combine them?</p>

<p>these all fail:</p>

<pre><code>var form_or_a_tag = elem[i].getElementsByTagName('a form');
var form_or_a_tag = elem[i].getElementsByTagName('a, form');
var form_or_a_tag = elem[i].getElementsByTagName('a') || elem[i].getElementsByTagName('form');
</code></pre>

<p>Basically I would like to store in the variable <code>form_or_a_tag</code> all <code>form</code> or <code>a</code> tags that reside in the element currently being iterated.</p>
