【发布时间】:2021-05-27 00:17:53
【问题描述】:
有谁知道为什么自定义属性选择器在 IE11 中不起作用,或者还有其他选择自定义属性的方法吗? 我在 Chrome 上运行的代码:
$("[aria-label='" + tempSearchString + "']")
.parent()
.css({
"background-color": "#ae924d",
"color": "white",
"cursor": "pointer"
});
我也尝试过使用过滤器,但它似乎在 IE 中不起作用:
$("abbr").filter("[aria-label='" + tempSearchString + "']")
【问题讨论】:
-
我无法使用您提供的代码重现该问题。我做了一个示例like this,它在 IE 11 中运行良好。您是否使用 F12 开发工具检查 IE 11 中的控制台是否有任何错误?您如何获得
tempSearchString?我建议您也可以提供相关的html代码并制作a minimal code snippet,它可以重现问题。这样我们就可以进行测试,看看如何提供帮助。
标签: html jquery jquery-selectors internet-explorer-11