jQuery विविध प्राप्त करें () विधि
उदाहरण
पहले <p> तत्व का नाम और मूल्य प्राप्त करें:
$("button").click(function(){
var x = $("p").get(0);
$("div").text(x.nodeName + ": " + x.innerHTML);
});
परिभाषा और उपयोग
प्राप्त () विधि चयनकर्ता द्वारा निर्दिष्ट DOM तत्व प्राप्त करती है।
वाक्य - विन्यास
$(selector).get(index)
Parameter | Description |
---|---|
index | Optional. Specifies which of the matching elements to get (by index number) |