Prepend Elements Inside Each Matching Element .prepend()

.prepend(content)

content: {One or more DOM elements, arrays of elements, HTML strings, or jQuery objects | Function( Integer index, String html )}
e.g. $("div").prepend("<b>text</b>")

.prepend(content) will insert content inside and to the beginning of each element in the matched set.

Example 1: $("div").prepend("<span>inserted</span>") will prepend <span>inserted</span> to each <div>.
Before
<div>
  <b>A</b>
</div>
<div>
  <b>B</b>
</div>
After
<div>
  <span>inserted</span>
  <b>A</b>
</div>
<div>
  <span>inserted</span>
  <b>B</b>
</div>
Example 2: $("div").prepend("<span>insert1</span>", "<span>insert2</span>") will prepend <span>insert1</span><span>insert2</span> inside each <div>.
Before
<div>
  <b>A</b>
</div>
<div>
  <b>B</b>
</div>
After
<div>
  <span>insert1</span>
  <span>insert2</span>
  <b>A</b>
</div>
<div>
  <span>insert1</span>
  <span>insert2</span>
  <b>B</b>
</div>
Example 3: $("div").prepend($("b")) will move all <b> inside <div>.
Before
<div></div>
<b>A</b>
<b>B</b>
After
<div>
<b>A</b>
<b>B</b>
</div>
Example 4: $("div").prepend( function(index) { return "<span>"+index+"</span>" ;}) passed functoin will return <span>index</span> for each <div> where index is <div> index in the matched set.
Before
<div>
  <b>A</b>
</div>
<div>
  <b>B</b>
</div>
After
<div>
  <span>0</span>
  <b>A</b>
</div>
<div>
  <span>1</span>
  <b>B</b>
</div>
jQuery manipulation insertion .prepend()