jQuery Miscellaneous get() method
Example
Get the first
The element's name and value:
$("button").click(function(){
x=$("p").get(0);
$("div").text(x.nodeName + ": " + x.innerHTML);
});
Try it »
Definition and Usage
The get() method retrieves the DOM element specified by the selector.
Syntax
$(
selector
).get(
index
)
| Parameters | Description |
|---|---|
| index | Optional. Specifies which matched element to retrieve (by index number). |
jQuery Miscellaneous Methods