Retrieving native DOM elements from jQuery objects?

后端 未结 5 1293
谎友^
谎友^ 2021-01-04 03:10

How can I get jQuery to return the native DOM elements it encapsulates?

5条回答
  •  庸人自扰
    2021-01-04 03:36

    I assume you're trying to check if your jQuery object is the first instance of "cheese_tag". You can find the first tag with the :first selector and then you wouldn't need to do the comparison. For example, get the first div tag would be: $('div:first').

    For the complete list of jQuery selectors, see the documentation.

提交回复
热议问题