[英]Hide all li tags with jquery
Please help me to complete my code. 请帮助我完成我的代码。 I want to hide all <li>
tags on body onload. 我想隐藏身体onload上的所有<li>
标签。
$(document).ready(function () {
$('li > ul').hide();
});
Please give me the right variant for the code! 请给我正确的代码变体!
是ul > li
,不是li > ul
$(document).ready(function () { $('ul > li').hide(); });
$(function(){
$('li').hide()
})
This will search and hide every <li>
tag on the page. 这将搜索并隐藏页面上的每个<li>
标签。 It is better to narrow down the search to improve performance Ex: $('#mydiv li')
where mydiv
is the id of the ul tag <ul id="mydiv">
. 最好缩小搜索范围以提高性能Ex: $('#mydiv li')
其中mydiv
是ul标签<ul id="mydiv">
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.