为什么display = "none"
在jsFiddle中单击按钮时不起作用?单击按钮时未隐藏的元素
HTML:
<div>This is a visible heading<div>
<div class="hidden">This is a hidden heading</div>
<div>Notice that the hidden heading still takes up space.</div>
<hr/>
的JavaScript:
$('input[type=button]').click(function() {
document.getElementsByClassName("hidden").style.display = "none";
});
大声笑,为什么混合jQuery的一个香草JS? – nicael
http://jsfiddle.net/pUeue/3446/ –
@nicael,因为它们都是库:))) – madalinivascu