title: add an element before another with jquery
body: <p>I have the following dom :</p>
  
  <pre><code>&lt;div class="test"&gt;1&lt;/div&gt;
  &lt;div class="test"&gt;2&lt;/div&gt;
  &lt;div class="test"&gt;3&lt;/div&gt;
  &lt;div class="test"&gt;4&lt;/div&gt;
  </code></pre>
  
  <p>I would like to add before the nth test element a new element.</p>
  
  <p>I am able to add a new element for all the test element with this code :</p>
  
  <pre><code>var newElement = "div class=\"test-new\""; 
  $(".test").before(newElement);
  </code></pre>
  
  <p>But I am not able to select only the desired element thanks to an index(example : 3), these 2 codes throws an error :</p>
  
  <pre><code>var newElement = "div class=\"test-new\""; 
  $(".test")(3).before(newElement);
  $(".test")[3].before(newElement);
  </code></pre>