开发者

jQuery get DOM node? [duplicate]

开发者 https://www.devze.com 2022-12-21 11:24 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to get a DOM Element from a JQuery Selector
This question already has answers here: Closed 11 years ago.

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()?


You can retrieve DOM elements using array notation:

$("#element_id")[0]

or with get():

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

精彩评论

暂无评论...
验证码 换一张
取 消