gpt4 book ai didi

javascript - 根据样式选择html元素

转载 作者:行者123 更新时间:2023-11-28 07:44:27 24 4
gpt4 key购买 nike

我有这段代码可以更改提供的 html 元素列表的边框

xh.highlightNodes = function (nodes) {
for (var i = 0, l = nodes.length; i < l; i++) {
nodes[i].style.border = "4px solid blue";
}
};

现在我想删除触发某些事件的边框。我该怎么做?

我试过了,但似乎不起作用。

$('html').filter(function () {
return $(this).css('border') == '4px solid blue';
}).css('border', '');

最佳答案

试试下面的,

.css('border', 'none');

关于javascript - 根据样式选择html元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30778282/

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