JAVASCRIPT产生随机函数

 1 None.gif   < script type = " text/javascript " >
 2 None.gif        function CreateUserID()
 3 ExpandedBlockStart.gifContractedBlock.gif         dot.gif {
 4InBlock.gif            var hotelID=document.getElementById("txtHotelID");
 5InBlock.gif            var userID=document.getElementById("txtUserID");
 6InBlock.gif            var sRand="";
 7InBlock.gif            for(var i=0;i<4;i++)
 8ExpandedSubBlockStart.gifContractedSubBlock.gif            dot.gif{
 9InBlock.gif                sRand=sRand + (parseInt(Math.random()*9)).toString(); 
10InBlock.gif
11ExpandedSubBlockEnd.gif            }

12InBlock.gif            userID.value=hotelID.value + sRand;
13ExpandedBlockEnd.gif        }

14 None.gif        
15 None.gif     </ script >

转载于:https://www.cnblogs.com/zhangchenliang/archive/2008/02/22/1078240.html

猜你喜欢

转载自blog.csdn.net/weixin_34346099/article/details/93495959
今日推荐