課程
/前端開發
/JavaScript
/JavaScript入門篇
我覺得代碼對了,不過執行不出來啊
2015-04-06
源自:JavaScript入門篇 4-1
正在回答
<input type="button" value="改變顏色" onclick="gs()"> ?
? ? <input type="button" value="改變寬高" onclick="gg()">
? ? <input type="button" value="隱藏內容" onclick="yc()">
? ? <input type="button" value="顯示內容" onclick="xs()">
? ? <input type="button" value="取消設置" onclick="qx()">
那啥backgroundColor打錯了?var content=document.getElementById(txt);最好txt兩邊加引號,不過我試了一下,不加也沒關系。
然后 我試了快一個小時 發現 你把函數改成這樣的就能用了。我的代碼和你的差不多 就是函數名不一樣。。。
簡直太奇葩了。完全不明白為什么函數名有問題。
試試這樣吧 。
與君共勉。
另外,var content=document.getElementById(txt);txt要加引號
你第一個函數處多了個},小錯誤多注意
舉報
JavaScript做為一名Web工程師的必備技術,本教程讓您快速入門
2 回答怎么執行不出來???
3 回答不能運行代碼,不知道哪兒出問題了
3 回答請問哪里不對了啊?執行不出來
2 回答運行不出結果來,想知道哪里不對,求幫忙
4 回答不知道對不對
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2015-04-07
<input type="button" value="改變顏色" onclick="gs()"> ?
? ? <input type="button" value="改變寬高" onclick="gg()">
? ? <input type="button" value="隱藏內容" onclick="yc()">
? ? <input type="button" value="顯示內容" onclick="xs()">
? ? <input type="button" value="取消設置" onclick="qx()">
那啥backgroundColor打錯了?var content=document.getElementById(txt);最好txt兩邊加引號,不過我試了一下,不加也沒關系。
然后 我試了快一個小時 發現 你把函數改成這樣的就能用了。我的代碼和你的差不多 就是函數名不一樣。。。
簡直太奇葩了。完全不明白為什么函數名有問題。
試試這樣吧 。
與君共勉。
2015-04-06
另外,var content=document.getElementById(txt);txt要加引號
2015-04-06
你第一個函數處多了個},小錯誤多注意