gpt4 book ai didi

jQuery 使用 .filter() 作为 .addClass()

转载 作者:行者123 更新时间:2023-12-01 04:45:31 25 4
gpt4 key购买 nike

我正在尝试使用 .filter() 来 .addClass() 输入并选择 .this-class 下的内容,不幸的是我下面的代码不起作用。

有什么想法应该如何运作吗?

$('.this-class').filter('input', 'select').addClass('input-sm');

最佳答案

您选择了错误的过滤项目。

更改:

$('.this-class').filter('input', 'select').addClass('input-sm');

至:

$('.this-class').filter('input, select').addClass('input-sm');

关于jQuery 使用 .filter() 作为 .addClass(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30471693/

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