Insert Elements Before Each target Element .insertBefore(target)

.insertBefore(target)

target: {selector, html String, Element, jQuery Object}
e.g. $("<b>text</b>").insertBefore("div")

.insertBefore(target) will insert all elements in the matched set before each target element.

Example 1: $("<span>inserted</span>").insertBefore("div") will insert <span>inserted</span> before each <div>.
Before
<div>A</div>
<div>B</div>
After
<span>inserted</span>
<div>A</div>

<span>inserted</span>
<div>B</div>
Example 2: $("b").insertBefore("div") will move all <b> before <div>.
Before
<div>C</div>
<b>A</b>
<b>B</b>
After
<b>A</b>
<b>B</b>
<div>C</div>
jQuery manipulation insertion .insertBefore(target)