js 产生任意位数的随机数 function RndNum(n){var rnd="";for(var i=0;i<n;i++){rnd += Math.floor(Math.random()*10);}$("#code").val(rnd);//给文本框赋值}