亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

點按鈕沒效果啊,求大神幫我看看哪里錯了,找了好久都沒找到bug

<!DOCTYPE html>

<html>

<head>?

<meta charset="utf-8">?

<style type="text/css">

#div1{

? ? height:300px;

? ? width:500px;

? ? background-color:lightblue;

? ? color:black;

? ? margin:100px auto;

}

</style>


</head>

<body>

<div id="div1">

? ? <p>雖然我也不知道輸入什么</p>

? ? <p>那我就瞎他媽寫一寫吧</p>

? ? <p>哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈。</p>


</div>

<form>

<input type="button" onclick="color()" value="改變顏色">

<input type="button" onclick="wh()" value="改變寬高">

<input type="button" onclick="hh()" value="隱藏">

<input type="button" onclick="see()" value="顯示">

<input type="button" onclick="hde()" value="取消設置">


</form>



<script type="text/javascript">


? ? function color(){

? ? ?var d=document.getElementById("div1"); ??

? ? ?d.style.color="red";

? ? ?d.style.background-color="green";

? ? }

//改變顏色


? ? function wh(){

? ? ? ? var div1=document.getElementById("div1");

? ? ? ? div1.style.width="800px";

? ? ? ? div1.style.height="200px";

? ? //改變寬高

? ? }

? ? function hh{

? ? ? ? var div1=document.getElementById("div1");

? ? ? ? div1.style.display="none";

? ? }//隱藏


? ? function see(){

? ? ? ? var div1=document.getElementById("div1");

? ? ? ? div1.style.display="block";

? ? }//顯示


? ? function hde(){

? ? ? ?var div1=document.getElementById("div1");

? ? ? ? var x=confirm("是否取消設置?");

? ? ? ? if(x==true){

? ? ? ? ? ? div1.style.height="300px";

? ? div1.style.width="500px";

? ? div1.style.background-color="blue";

? ? div1.style.color="black";

? ? div1.style.margin="100px auto";

? ? ? ? }

? ? ? ? else{

? ? ? ? ? ? alert("不要搞事情");

? ? ? ? }


? ? }//取消設置

</script>


</body>

</html>


正在回答

1 回答

background-color ? ? ? ? ? ? ?改為:backgroundColor ? ? ? hh函數少了 () ? ? ? ? ? ?加油!!!!加油!!!!

0 回復 有任何疑惑可以回復我~
#1

_不顧 提問者

改了之后還是不行TUT……5個按鈕都沒有反應……
2017-07-31 回復 有任何疑惑可以回復我~
#2

_不顧 提問者

哦哦我成功了,之前有個background-color忘記改……謝謝你!?。(*////▽////*)q
2017-07-31 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

點按鈕沒效果啊,求大神幫我看看哪里錯了,找了好久都沒找到bug

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號