gpt4 book ai didi

javascript - 查询 :not selector with wildcard

转载 作者:太空宇宙 更新时间:2023-11-03 20:16:27 27 4
gpt4 key购买 nike

我正在创建一个简单的 onclick 函数,它隐藏与链接具有相同循环编号的 div。我正在用头撞砖墙试图让非选择器工作。

在伪类中,我希望所有类以“title”开头的 div 除了当前的之外,高度都为 0px。

$('div.[class^="title"]:not([class='title<?php echo $count;?>'])').css('height', '0px');

$count 是当前循环。

这是我设法创建的行。这个语法正确吗?

最佳答案

尝试

$('div.[class^="title"]:not([class="title<?php echo $count;?>"])').css('height', '0px');
//Changed single to double quote ^ ^

关于javascript - 查询 :not selector with wildcard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19909007/

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