Example 1 — Official Demo: Prepend HTML
Insert a bold greeting as the first child of every paragraph.
// <p>there, friend!</p><p>amigo!</p>
$("p").prepend("<b>Hello </b>"); How It Works
- Select paragraphs. Both
<p>elements match. - Pass HTML. jQuery parses
<b>Hello </b>. - Insert first. Each paragraph gets that markup as its first child.

