更多语言
更多操作
删除的内容 添加的内容
imported>Sonicth0623 无编辑摘要 |
imported>Sonicth0623 无编辑摘要 |
||
第2行:
<p>本页面仅作测试使用,当前测试人:[[User:Sonicth0623|Sonicth0623]]([[User talk:Sonicth0623|留言]])</p>
<div id="spoiler" style="display: block;">隐藏</div>
<input type="button" name="" id="hidebutton" value="隐藏" onclick="test()" />
<script>var spo = document.getElementById('spoiler');
var hidbutton = document.getElementById('hidebutton');
if (spo.style.display = 'block'){
var sposta = 'block';
}
else {
var sposta = 'block';
}
function test(){
if(sposta == 'block') {
spo.style.display = 'none';
sposta = "none";
hidbutton.value = "显示"
}
else {
spo.style.display = 'block';
sposta = 'block';
hidbutton.value = "隐藏"
}
}
|
2022年3月4日 (五) 19:25的版本
本页面仅作测试使用,当前测试人:Sonicth0623(留言)
隐藏
<input type="button" name="" id="hidebutton" value="隐藏" onclick="test()" /> <script>var spo = document.getElementById('spoiler'); var hidbutton = document.getElementById('hidebutton'); if (spo.style.display = 'block'){ var sposta = 'block'; } else { var sposta = 'block'; } function test(){ if(sposta == 'block') { spo.style.display = 'none'; sposta = "none"; hidbutton.value = "显示" } else { spo.style.display = 'block'; sposta = 'block'; hidbutton.value = "隐藏" } }