已采納回答 / weixin_慕前端8193251
?<input type="button" value="改變顏色" onclick="changeColor()"/>??? ? <input type="button" value="改變寬高" onclock="changeWidth()"/>? ? <input type="button" value="隱藏內容" onclock="hide()"/>? ? <input type="button" value="顯示內容" onclock="show()...
2020-03-04
已采納回答 / 三大法則
共 四 ?處錯誤?? function sethwidthheight(){??????? var b=document.getElementById("txt");??????? e.style.width=100px;??????? e.style.height=100px;?函數(shù)名多了個h,變量名不統(tǒng)一,b改成e就行了,100px需要加引號?var c=confirm("你確定要恢復所有設置嗎?");??????? if(c==true){??????????? e.removeAttribute(...
2020-02-25
已采納回答 / 慕用1151135
function cancel(){ var c=confirm.("確定恢復嗎?");? if(c=true)? {? ? ? a.removeAttribute("style");? ? ? b.removeAttribute("style");? }你最后一段代碼有幾個問題var c=confirm.("確定恢復嗎?");括號前多了一個點。? if(c=true)這里應該為雙等號 ?if(c==true)? a.removeAttribute("style");這里應該為單引號‘ style’改了之...
2020-02-22