1
<
script type
=
"
text/javascript
"
>
2 function CreateUserID()
3 {
4 var hotelID=document.getElementById("txtHotelID");
5 var userID=document.getElementById("txtUserID");
6 var sRand="";
7 for(var i=0;i<4;i++)
8 {
9 sRand=sRand + (parseInt(Math.random()*9)).toString();
10
11 }
12 userID.value=hotelID.value + sRand;
13 }
14
15 </ script >
2 function CreateUserID()
3 {
4 var hotelID=document.getElementById("txtHotelID");
5 var userID=document.getElementById("txtUserID");
6 var sRand="";
7 for(var i=0;i<4;i++)
8 {
9 sRand=sRand + (parseInt(Math.random()*9)).toString();
10
11 }
12 userID.value=hotelID.value + sRand;
13 }
14
15 </ script >
转载于:https://www.cnblogs.com/zhangchenliang/archive/2008/02/22/1078240.html