jQuery get DOM node?

JqueryDom

Jquery Problem Overview


> Possible Duplicate:
> How to get a DOM Element from a JQuery Selector

I can select a node using jQuery with something like $('#element_id') but how would I get the DOM element for use with non-jQuery functions that expect something like would be returned by document.getElementById()?

Jquery Solutions


Solution 1 - Jquery

You can retrieve DOM elements using array notation:

$("#element_id")[0]

or with get():

$("#element_id").get(0)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmpenView Question on Stackoverflow
Solution 1 - JquerycletusView Answer on Stackoverflow