Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

jQuery Misc get() Method

❮ jQuery Misc Methods

Example

Get the name and value of the first <p> element:

$("button").click(function(){
  var x = $("p").get(0);
  $("div").text(x.nodeName + ": " + x.innerHTML);
});
Try it Yourself »

Definition and Usage

The get() method gets the DOM elements specified by the selector.


Syntax

$(selector).get(index)

Parameter Description
index Optional. Specifies which of the matching elements to get (by index number)

❮ jQuery Misc Methods