标签:
//获取长度为len的随机字母
//获取长度为len的随机字母 function zimu(len){ len = len || 1; var $chars = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ‘; var maxPos = $chars.length; var pwd = ‘‘; for (i = 0; i < len; i++) { pwd += $chars.charAt(Math.floor(Math.random() * maxPos)); } //引用 $("#Editor").val(mingzi(5)); //生成5个字母
//获取随机邮箱后续 function youxiang(){ var Arr = ["@qq.com","@163.com","@sina.cn"]; var n = Math.floor(Math.random()*Arr.length + 1)-1; //alert(Arr[n]); return Arr[n]; }; //引用 $("#Email").val(youxiang());
标签:
原文地址:http://www.cnblogs.com/Akgu/p/5137967.html