大家好, 下面的代码隐藏了我在后面播放的电影。删除元素(如果可能)或禁用它,特别是在后台播放电影。我尝试使用document.video.disabled = true;但它不起作用。不知道如何去解决这个问题,请..JavaScript禁用div元素提交
<script type="text/javascript">
function showHide() {
var div = document.getElementById('wrapper');
if (div.style.display == 'none') {
div.style.display = '';
}
else {
div.style.display = 'none';
}
}
<form id="searchForm" name = "searchForm" onSubmit = "return fetchResults();">
<input id="q" name="q" type="text" alt="Search" placeholder="Type here">
<input type="hidden" name="wt" value="json" />
<input id="submit" type="button" value="Search" onClick = "fetchResults();showHide();changeStyle();" />
<div id="wrapper" style="display:''">
<div id="left">
random text
</div>
<div id="right">
<video width="500" height="300" controls="controls" autoplay="autoplay" name="video">
<source src="movie.mov" type="video/mp4" />
<embed src="movie.swf" width="600" height="500" />
</object>
</video>
</div>
</div>
感谢
为什么不直接用'显示隐藏:none'? – j08691 2012-08-10 18:40:43
电影仍然保持幕后音频 – Chinmay 2012-08-10 18:41:19
你想隐藏或删除元素? – 2012-08-10 18:41:24