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

