$("li:has('label')").css("background-color", "blue");
2015-07-16
<div>元素中的全部子<label>元素,全部的子元素,一不小心看成了全部元素。。。。
2015-07-16
$("div label").css("background-color","blue");
2015-07-16
toggle() 方法切换元素的可见状态。
如果被选元素可见,则隐藏这些元素,如果被选元素隐藏,则显示这些元素。
如果被选元素可见,则隐藏这些元素,如果被选元素隐藏,则显示这些元素。
2015-07-16
$("li[name!='s']").hide();
function changeSts(){
var text = $("a").html();
if(text == "更多"){
$("li[name!='s']").show();
$("a").html("简化");
}else{
$("li[name!='s']").hide();
$("a").html("更多");
}
}
function changeSts(){
var text = $("a").html();
if(text == "更多"){
$("li[name!='s']").show();
$("a").html("简化");
}else{
$("li[name!='s']").hide();
$("a").html("更多");
}
}
<script>
$("li:nth-child(5)~li").hide();
$("a").click(function(){
if ($(this).html()=='更多')
{
$(this).html('简化');
$("li:nth-child(5)~li").show();
}
else
{
$(this).html('更多');
$("li:nth-child(5)~li").hide();
}
})
</script>
$("li:nth-child(5)~li").hide();
$("a").click(function(){
if ($(this).html()=='更多')
{
$(this).html('简化');
$("li:nth-child(5)~li").show();
}
else
{
$(this).html('更多');
$("li:nth-child(5)~li").hide();
}
})
</script>