Example 1 — Create Markup and Insert
Build an element on the fly, then drop it into a list.
$("<li>Cherry</li>").appendTo("#fruits"); How It Works
- Create.
$("<li>Cherry</li>")builds a new list item. - Target.
#fruitsis the container that receives it. - Insert.
.appendTo()places the item as the last child.

