<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標題文檔</title><script type="text/jscript">function ?hidetext(){var clo=confirm("真的要的隱藏嗎?");if (clo = true){ document.getElementById("con").style.display="none" ; } else{ alert("關閉吧!"); } }function showtext(){ var open=confirm("要顯示咯"); if (open = true){ document.getElementById("con").style.display="block"; } else{ alert("那就算了吧"); }}</script></head><body><h1>這是要練習顯示和隱藏</h1><p id="con">八戶山倒數(shù)第皇帝使得撒的是大皇帝和撒旦會死的</p><input type="button" value="這是要隱藏" onclick="hidetext()" /><input type="button" value="這是要顯示" onclick="showtext()" /></body></html>
為什么我的confirm標簽,按取消后還是有確定的功能(內(nèi)容還是會消失)
qq_下一站晴天_04347469
2016-12-07 11:04:46