var num=parseInt(document.getElementById("agee").value);parseInt或者parseFloat方法转换一下就可以了,文本框里面获取出来的都是string刚学编程不久吧,加油