為什么一直運(yùn)行不正確~~~~
function mytext(){
box=document.getElementById("box");
sty=document.getElementById("sty").value;
val=document.getElementById("val").value;
if(sty=="color"){
box.style.color=val;}
else if(sty="backgroundcolor"){
box.style.backgroundColor=val;}
else if(sty=="height"){
box.style.height=parseInt(val)+"px";}
else if(sty="width"){
box.style.width=parseInt(val)+"px";}
else{
alert("輸入錯(cuò)誤");}
}
2018-12-21
判斷里面少寫了一個(gè)等于號(hào)。。。求采納。。謝謝