将 jquery 元素转换为 html 元素

发布于 2024-11-30 02:54:29 字数 71 浏览 3 评论 0原文

我有一个 jQuery 元素,但我必须将其发送到仅接受 HTML 元素的函数。如何将 jQuery 元素转换为 HTML 元素?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白况 2024-12-07 02:54:29

尝试 myJQueryElement.get(0)myJQueryElement[0]。 (例如,当您需要负索引时,get() 最有用,如 get() 文档中所述。)

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

世俗缘 2024-12-07 02:54:29

$("#foo")[0] 将为您提供一个 HTML 元素。使用括号比使用 .get() 快一点,但除非您这样做,否则您可能不会注意到数百万次

$("#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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文