value抓取的是字符串 我怎么转换成数字类型啊
var val1 = document.getElementById("txt1").value;
var ys = document.getElementById("select").value;
var val2 = document.getElementById("txt2").value;
if(ys == "+"){
var val3 = val1 + val2;
}
var val1 = document.getElementById("txt1").value;
var ys = document.getElementById("select").value;
var val2 = document.getElementById("txt2").value;
if(ys == "+"){
var val3 = val1 + val2;
}
2015-10-06
举报