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

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

找不到錯誤呀,求幫忙

?<form>

? <!--當點擊相應按鈕,執行相應操作,為按鈕添加相應事件-->

? ? <input type="button" onClick="chang1()" value="改變顏色" > ?

? ? <input type="button" onClick="chang2()" value="改變寬高" >

? ? <input type="button" onClick="chang3()" value="隱藏內容" >

? ? <input type="button" onClick="chang4()" value="顯示內容" >

? ? <input type="button" onClick="chang5()" value="取消設置" >

? </form>

? <script type="text/javascript">

? var mystr=document.getElementById("txt");

//定義"改變顏色"的函數

? function chang1(){

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

? ? ? mystr.style.backgroundColor="green";

? }


//定義"改變寬高"的函數

? function chang2(){

? ? ? mystr.style.wedth="100px";

? ? ? mystr.style.height="400px";

? }


//定義"隱藏內容"的函數

? ?function chang3(){

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

? ?}


//定義"顯示內容"的函數

? ?function chang4(){

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

? ?}


//定義"取消設置"的函數

? ?function chang5(){

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

? ? ? ?if(mymassage==true)

? ? ? ?{

? ? ? ? ? ? ?txt.removeAttribute("style");

? ?}



? </script>


正在回答

2 回答

??function?chang5(){
???????var?mymassage=confirm("是否取消設置?");
???????if(mymassage==true)
???????{
?????????????txt.removeAttribute("style");
???}
???txt是什么????你上面不是獲取了嗎???mystr.removeAttribute("style")


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

123Zhou123 提問者

找不到錯誤瞎試的,mystr.removeAttribute("style")這個我也試過了,也不對。。。。。
2015-07-19 回復 有任何疑惑可以回復我~

找不到錯誤瞎試的,mystr.removeAttribute("style")這個我也試過了,也不對。。。。。

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

淺水了

那是什么錯誤?
2015-07-19 回復 有任何疑惑可以回復我~
#2

123Zhou123 提問者 回復 淺水了

哦,漏掉了一個括號 ,謝謝幫忙O(∩_∩)O~~~~~~~~
2015-07-19 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
JavaScript入門篇
  • 參與學習       741187    人
  • 解答問題       9866    個

JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門

進入課程

找不到錯誤呀,求幫忙

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

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

幫助反饋 APP下載

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

公眾號

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