今天迎来了2018年第一场雪,这个美好的日子,总的写点什么纪念一下,在这里写了一个在js中使用Math.random()函数,随机生成四位数的验证码及其验证码换颜色. js代码如下: var arrayTest= ["m","n","v","x","z","a","b","c","d","e","f…
<script> function selectForm(lowerValue,upperValue){ var choices=upperValue-lowerValue+1; return Math.floor(Math.random()*choices+lowerValue) } var colors=["red","green","blue","yellow","black","…
function getRandomColor(){ var colorValue = [0,1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f']; var s = "#"; for (var i=0;i<6;i++) { s+=colorValue[Math.floor(Math.random()*16)]; } return s; }…
function a(a) { var d, e, b = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", c = ""; for (d = 0; a > d; d += 1) e = Math.random() * b.length, e = Math.floor(e), c += b.charAt(e); return c }…