【发布时间】:2017-05-02 09:09:24
【问题描述】:
过滤器功能在 IE 11 Edge 中不工作,但在 Chrome 中工作正常 和 Mozilla 。我正在处理以下代码
var data = $(".chartsValue text");
var filteredData=data.filter(function()
{ return $(this).css('font-weight') == 'bold';
}).text();
我在下面的 html 中获取值
<g class="chartsValue" style="cursor:pointer;text-align:center;" transform="translate(101,10)">
<rect x="0" y="0" width="19" height="16" strokeWidth="0" fill="none" rx="0" ry="0">
</rect>
<text x="0.828125" zIndex="1" style="font-size:11;font-weight:bold;color:black;fill:black;" y="14">
6m
</text>
所以,我也需要通过 IE Edge 中的样式获取 6m 值
【问题讨论】:
-
您是否尝试过使用原生对象而不是 jQuery 包装对象? IE11 的 jQuery 中可能存在错误
-
感谢@DanielCooke 我相信 $(this).css 在 IE 中无法正常工作
标签: javascript jquery html css .net