自定义属性选择器在 IE11 中不起作用
Custom attribute selector not working in IE11
有谁知道为什么自定义属性 selector 在 IE11 中不起作用,或者是否有其他替代 select 自定义属性的方法?
我的代码适用于 Chrome:
$("[aria-label='" + tempSearchString + "']")
.parent()
.css({
"background-color": "#ae924d",
"color": "white",
"cursor": "pointer"
});
我也用过滤器试过了,但它在 IE 中似乎不起作用:
$("abbr").filter("[aria-label='" + tempSearchString + "']")
问题出在我使用的 React 库中,它创建了那些自定义属性,并将一些“不可见”字符放在自定义属性的 beginning/end 处。当我比较 tempSearchString
的字符串和我试图捕捉的属性时,它们在书写上看起来是一样的,但 Text Compare 仍然发现了差异。我决定不使用这个库并针对该问题编写了自己的代码。
有谁知道为什么自定义属性 selector 在 IE11 中不起作用,或者是否有其他替代 select 自定义属性的方法? 我的代码适用于 Chrome:
$("[aria-label='" + tempSearchString + "']")
.parent()
.css({
"background-color": "#ae924d",
"color": "white",
"cursor": "pointer"
});
我也用过滤器试过了,但它在 IE 中似乎不起作用:
$("abbr").filter("[aria-label='" + tempSearchString + "']")
问题出在我使用的 React 库中,它创建了那些自定义属性,并将一些“不可见”字符放在自定义属性的 beginning/end 处。当我比较 tempSearchString
的字符串和我试图捕捉的属性时,它们在书写上看起来是一样的,但 Text Compare 仍然发现了差异。我决定不使用这个库并针对该问题编写了自己的代码。