Select First Matching Element .first()


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

$("selector").first() selects first element in the matched set.

Example 1: $("div").first() will first find all <div> then filter them by selecting first matching element i.e. first div.
<div id='someID'>div-1</div>
<div class='someClass'>div-2</div>
Matched set is a set of elements matching selector. For example, in Example 1 matchted set is set of elements matching $("div") selector
<div id='someID'>div-1</div> //index = 0
<div class='someClass'>div-2</div> //index = 1
<div>div-3</div> //index = 2
jQuery traversing filtering .first()