javascript 的alert的变量输出

<form name="testform" method="post" action="add.php">     
<input type="text" name="username" id="username"/>
<input type="text" name="tel" id="tel" />
<nput type="submit" name="send" value="提交订单" onclick="return CheckForm()"/>
</form>

//fmcheck.js

function CheckForm(){
var username = document.getElementById("username").value;
var tel = document.getElementById("tel").value;

var info="您好,您订购的信息为:姓名:"+username+",电话:"+tel;
alert (info);

}
原文地址:https://www.cnblogs.com/shjy5/p/2844605.html