我感覺只是不是這個頁面的BUG??出現(xiàn)未知情況了。
? <input type="button" value="改變顏色" onclick="a1()"> ?
? ? <input type="button" value="改變寬高" onclick="a2()">
? ? <input type="button" value="隱藏內(nèi)容" onclick="a3()">
? ? <input type="button" value="顯示內(nèi)容" onclick="a4()">
? ? <input type="button" value="取消設(shè)置" onclick="a5()">
? </form>
? <script type="text/javascript">
? function a1(){
? ? ? document.getElementById("txt").style.color="red";
? }
//定義"改變顏色"的函數(shù)
function a2(){
? ? ? document.getElementById("txt").style.width="400px";
? }
//定義"改變寬高"的函數(shù)
function a3(){
? ? ? document.getElementById("txt").style.display="none";
? }
//定義"隱藏內(nèi)容"的函數(shù)
function a4(){
? ? ? document.getElementById("txt").style.display="block";
? }
//定義"顯示內(nèi)容"的函數(shù)
function a5(){
? ? var haha = prompt("你確定取消設(shè)置?");
? ? ? if(haha==ture){
? ? ? ? ? ?document.getElementById("txt").removeAttribute('style');
? ? ? }
? }
我的a5沒法運行,如果把a4改成a,顯示也沒法運行了。這就完全看不懂了
2016-08-23
function a5(){
? ? var haha = prompt("你確定取消設(shè)置?");
? ? ? if(haha==ture){
大哥 你這個哈哈為真這個地方的括號應(yīng)該是中文?。?!敲黑板!!細(xì)心點呀!?。?/p>