//判断指定父元素下,是否有子元素,如果无则隐藏父元素。var pre = document.getElementById("pre"); var next = document.getElementById("next");var pre_child = pre.getElementsByTagName("a");var next_child = next.getElementsByTagName("a");if (next_child.length==0) { next.style.display = "none";}else if (pre_child.length==0) { pre.style.display = "none";}else{}
添加回答
举报
0/150
提交
取消