jQuery .index() in javascript
<p>As per the jQuery api, the complementary operation to .get(), which accepts an index and returns a DOM node, <code>.index()</code> can take a DOM node and returns an index. Suppose we have a simple unordered list on the page:</p>

<pre><code>&lt;ul&gt;
  &lt;li id="foo"&gt;foo&lt;/li&gt;
  &lt;li id="bar"&gt;bar&lt;/li&gt;
  &lt;li id="baz"&gt;baz&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p><code>.index()</code> will return the position of the first element within the set of matched elements in relation to its siblings:</p>

<pre><code>alert('Index: ' + $('#bar').index();
</code></pre>

<p>We get back the zero-based position of the list item:</p>

<pre><code>Index: 1
</code></pre>

<p>I just want to know, how can we do the same using <strong>JavaScript</strong>?? </p>
