gpt4 book ai didi

jquery - 选择 id 中包含 unicode 字符的标签

转载 作者:行者123 更新时间:2023-12-01 03:34:58 25 4
gpt4 key购买 nike

在 HTML 5 中,标记的 id 属性中允许使用 unicode 字符。 jQuery 使用的 Sizzle 库声称拥有完整的 unicode 支持。

我的 HTML 文件包括:

<p id='§'>Hello</p>

这样做会返回一个空数组:

$('§')

为什么这不起作用?

(使用 jQuery 2.2.3)

最佳答案

将 $('§') 更改为 $('#§').. 因为我们可以使用 # 访问任何具有其 id 的元素

关于jquery - 选择 id 中包含 unicode 字符的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37223617/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com