Convert jquery element to html element
Solution 1:
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()
.)
Solution 2:
$("#foo")[0]
will get you an HTML element. Using brackets is a tiny bit faster than using .get()
but not something you'll likely notice unless you are doing it millions of times.