Skip to content Skip to sidebar Skip to footer

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 objec

Solution 1:

Fetch first item from jQuery object

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

Solution 2:

You can use get (link to API).

 element.get()

It will return an array.


Post a Comment for "Getting Html DOM Element From JQuery Element"