Example 1 — Official div span:first-child
Mark the first span in each div — one match per parent.
$("div span:first-child").each(function () {
$(this).text($(this).text() + " [first]");
}); How It Works
- Select.
div span:first-childfinds first spans only. - Per parent. Each div contributes one match.
- Mark. Append
[first]to those spans.

