更多語言
更多操作
刪去的內容 新增的內容
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 = "隱藏" } }