var number1 = document.getElementById("queue");
height1 = number1.value+("px");queue是一个输入框,number1.value是它的输入的值(一个数字),但是height1输出的始终是px,没有任何数字。比如:console.log(number1.value); //20console.log(height1);//px我还试了一种方法var number1 = document.getElementById("queue");var number1Value = number1.value;
height1 = number1Value+("px");这下更加奇怪,console.log(number1.value);//20console.log(number1Value);//console.log(number1.value.constructor == String);//true证明number1.value是字符串,那字符串加字符串应该可以啊
添加回答
举报
0/150
提交
取消