hi,
here is what i want to do:

e.g.
Code:
<div id="container">
	<h1>text</h1>
	<p>text</p>
	<p>text</p>
	<p>text</p>
	<p>text</p>
	<p>text</p>
	<random tag></<random tag>>
	.
	.
	.
	<h1>text</h1>
	<p>text</p>
	<p>text</p>
	.
	.
	.
</div>
i want to get list of all h1 and p, but i need to preserve order e.g h1pppppppph1ppppph1pp,
i can do this by getting all elements and then check if element.tagName == "h1" but this way i will check hundreds of elements that i dont need while getting only few h1 and p, is there a way to optimize it, or maybe better approach ?