Example 1 — Get One Element by Index
Read a raw DOM element from the set and inspect it.
var el = $("li").get(1);
console.log(el.tagName); // LI
console.log(el.textContent); // Banana
console.log(el === $("li")[1]); // true How It Works
- Select.
$("li")matches Apple, Banana, and Cherry. - Retrieve.
.get(1)returns the second node (zero-based). - Compare. It is the exact same node as
$("li")[1].

