admin管理员组文章数量:1323342
Please help me to plete my code.
I want to hide all <li>
tags on body onload.
$(document).ready(function () {
$('li > ul').hide();
});
Please give me the right variant for the code!
Please help me to plete my code.
I want to hide all <li>
tags on body onload.
$(document).ready(function () {
$('li > ul').hide();
});
Please give me the right variant for the code!
Share Improve this question edited Mar 19, 2011 at 23:29 Hussein 42.8k25 gold badges115 silver badges143 bronze badges asked Mar 19, 2011 at 6:52 Avaz Avaz 291 silver badge6 bronze badges2 Answers
Reset to default 5It's ul > li
, not li > ul
$(document).ready(function () { $('ul > li').hide(); });
$(function(){
$('li').hide()
})
This will search and hide every <li>
tag on the page. 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">
.
本文标签: javascriptHide all li tags with jqueryStack Overflow
版权声明:本文标题:javascript - Hide all li tags with jquery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742135464a2422349.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论