Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一段代码
<li id="node_8" rel="default" class="xx"></li>
是否有一种自动查找所有语句的方法 was rel="default",或者阻止它触发,或者通过 css 删除。
rel="default"
我需要使用livequery, 还是 jquery live。
livequery
live
只需尝试以下类似的方法来查找具有以下内容的元素rel=default:
rel=default
$('[rel=default]')
要删除所有带有 的元素rel=default,请调用remove():
remove()
$('[rel=default]').remove();
隐藏
您可以使用 jQuery.hide()方法,例如:
.hide()
$('[rel=default]').hide();
发现 rel 语句可以在 css 中使用。即li[rel~='default'] {display: none ;},任何包含 rel 声明=为 default 的 li 都不会显示。——</p>
li[rel~='default'] {display: none ;}
=