gpt4 book ai didi

jquery - MySQL 与 JQuery 中的 LIKE

转载 作者:行者123 更新时间:2023-12-01 03:29:42 24 4
gpt4 key购买 nike

我想用它们包含的文本过滤几个 SPAN:

$('spanFilter').filter(function(){
var html = $(this).html();
return //comparison html LIKE %asdf%
});

在比较中,我尝试做类似 MySQL 的 LIKE 的事情:

field LIKE %asdf%

我怎样才能实现这一目标?

最佳答案

field LIKE %asdf%

可以像这样工作

$("span:contains('asdf')")

:contains(text) - 匹配包含给定文本的元素。

关于jquery - MySQL 与 JQuery 中的 LIKE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/981457/

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