-2

有人可以解释一下我如何没有得到数字字符串,而是加号的结果吗?

这是我的代码:

var pr01 = 1.8;
var pr02 = 2.6;
//for field one 
        document.all.PRI.insertAdjacentText("BeforeEnd", pr01);


//for field two
        document.all.PRI.insertAdjacentText("BeforeEnd", pr02);
4

1 回答 1

1

尝试这个:

var pr01 = 1.8;
var pr02 = 2.6;

document.all.PRI.insertAdjacentText("BeforeEnd", pr01 + pr02);
于 2013-03-19T12:54:45.717 回答