Select First Matching Element $(":first")

$(":first")

e.g. $("div:first")

$(":first") selects first matching element, only one element.

Example 1: $("div:first") will find first matching <div> element.
<div>a</div>
<div>b</div>
<div>c</div>
Example 2: $("span:first") will find first matching <span> element.
<div>
  <p>a</p>
  <span>b</span>
  <span>c</span>
</div>
<div>
  <span>d</span>
  <span>e</span>
  <span>f</span>
</div>
jQuery selector filter $(":first")