Lolly
Lolly

Reputation: 36442

Getting html DOM element from JQuery element

Below code gives me JQuery object, which includes JQuery functions associated with.

var element = $("#element");

But how can I get the HTML DOM element from the above JQuery object ?

Upvotes: 0

Views: 87

Answers (2)

Vadim
Vadim

Reputation: 8789

Fetch first item from jQuery object

var element = $("#element")[0];

Upvotes: 3

tckmn
tckmn

Reputation: 59343

You can use get (link to API).

 element.get()

It will return an array.

Upvotes: 2

Related Questions