Getting previous element of given in dom model
<p>I have list of elements on my page</p>

<pre><code>input
input
span
input
span
etc
</code></pre>

<p>I want to select each input that sits before each span, and after do, whatever i will have to. Is there any available ways to do that?</p>
