Convert jquery element to html element

Freesnöw picture Freesnöw · Aug 19, 2011 · Viewed 65.1k times · Source

I have a jQuery element but I have to send it to a function that only accepts HTML elements. How can I convert the jQuery element to an HTML element?

Answer

jtbandes picture jtbandes · Aug 19, 2011

Try myJQueryElement.get(0) or myJQueryElement[0]. (get() is most useful when you need negative indices, for example, as described in the documentation for get().)