JAVASCRIPT产生随机函数
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![](/Images/OutliningIndicators/InBlock.gif)
11
}
12
userID.value=hotelID.value + sRand;
13
}
14
15
</script>
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
4
![](/Images/OutliningIndicators/InBlock.gif)
5
![](/Images/OutliningIndicators/InBlock.gif)
6
![](/Images/OutliningIndicators/InBlock.gif)
7
![](/Images/OutliningIndicators/InBlock.gif)
8
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
9
![](/Images/OutliningIndicators/InBlock.gif)
10
![](/Images/OutliningIndicators/InBlock.gif)
11
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
12
![](/Images/OutliningIndicators/InBlock.gif)
13
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
14
![](/Images/OutliningIndicators/None.gif)
15
![](/Images/OutliningIndicators/None.gif)