var number = +document.getElementById("tall1").value;
document.getElementById("knapp").onclick = doSomething;
function doSomething(){
var color = document.getElementById("graf1");
farge.style.height = number + "px";}
如何从var编号中获取值并将其设置为高度?
答案 0 :(得分:0)
我认为您应该重新订购代码。
document.getElementById("knapp").onclick = doSomething;
function doSomething(){
var number = +document.getElementById("tall1").value;
var color = document.getElementById("graf1");
farge.style.height = number + "px";
}