SOURCE

// 随机数
function random(max, min) {
  return Math.floor(Math.random() * (max - min + 1) + min);
}

// 随机姓名
function name() {
  // 随机姓氏
  var familyNames = new Array("赵","钱","孙","李","周","吴","郑","王","冯","陈","褚","卫","蒋","沈","韩","杨","朱","秦","尤","许","何","吕","施","张","孔","曹","严","华","金","魏","陶","姜","戚","谢","邹","喻","柏","水","窦","章","云","苏","潘","葛","奚","范","彭","郎","鲁","韦","昌","马","苗","凤","花","方","俞","任","袁","柳","酆","鲍","史","唐","费","廉","岑","薛","雷","贺","倪","汤","滕","殷","罗","毕","郝","邬","安","常","乐","于","时","傅","皮","卞","齐","康","伍","余","元","卜","顾","孟","平","黄" ,"和","穆","萧","尹");
  var familyName = familyNames[random(0, familyNames.length - 1)];

  // 随机名字
  var givenNames = new Array("子璇", "淼", "国栋", "夫文","瑞堂","甜","敏","尚","国贤","贺祥", "晨涛","昊轩","易轩","益辰","益帆","益冉","瑾春", "瑾昆","春齐","杨","文昊","东东","雄霖","浩晨", "熙涵", "溶溶", "冰枫", "欣欣", "宜豪", "欣慧", "建政","美欣", "淑慧", "文轩", "文杰", "欣源", "忠林", "榕润", "欣汝", "慧嘉", "新建", "建林", "亦菲", "林", "冰洁", "佳欣", "涵涵", "禹辰", "淳美", "泽惠", "伟洋","涵越", "润丽", "翔", "淑华", "晶莹", "凌晶", "苒溪", "雨涵", "嘉怡", "佳毅","子辰", "佳琪", "紫轩", "瑞辰", "昕蕊", "萌", "明远", "欣宜", "泽远", "欣怡","佳怡", "佳惠", "晨茜", "晨璐", "运昊", "汝鑫", "淑君", "晶滢", "润莎", "榕汕","佳钰", "佳玉", "晓庆", "一鸣", "语晨", "添池", "添昊", "雨泽", "雅晗", "雅涵","清妍", "诗悦", "嘉乐", "晨涵", "天赫", "玥傲", "佳昊", "天昊", "萌萌", "若萌");
  var givenName = givenNames[random(0, givenNames.length - 1)];

  return familyName + givenName;
}

// 随机身份证号码
function idCard() {
  // 随机区划代码,全国各省、自治区、直辖市的行政区划代码表(GB/T 2260-2007)
  var provinceArray = ["110000", "120000", "130000", "140000", "150000", "210000", "220000", "230000", "310000", "320000", "330000", "340000", "350000", "360000", "370000", "410000", "420000", "430000", "440000", "450000", "460000", "500000", "510000", "520000", "530000", "540000", "610000", "620000", "630000", "640000", "650000", "710000", "810000", "820000"];
  var address = provinceArray[random(0, provinceArray.length - 1)];

  // 随机年月日
  var monthArray = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
  var dayArray = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28"];
  var birthday = random(1978, 1988) + monthArray[random(0, monthArray.length - 1)] + dayArray[random(0, dayArray.length - 1)];

  // 加权因子
  var coefficientArray = ["7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2"];
  // 校验码
  var lastNumberArray = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];

  var s = Math.floor(Math.random() * 10).toString() + Math.floor(Math.random() * 10).toString() + Math.floor(Math.random() * 10).toString();
  var array = (address + birthday + s).split("");
  var total = 0;
  for (var i = 0; i < array.length; i++) {
    total = total + parseInt(array[i]) * parseInt(coefficientArray[i]);
  }
  var lastNumber = lastNumberArray[parseInt(total % 11)];

  return address + birthday + s + lastNumber;
}

// 随机银行卡号
function bankCard() {
  // 随机行别代码
  var levelArray = ["102", "103", "104", "105", "301"];
  var number = "";
  switch (levelArray[random(0, levelArray.length - 1)]) {
  case "102":
    number = "622202";
    break;
  case "103":
    number = "622848";
    break;
  case "104":
    number = "621661";
    break;
  case "105":
    number = "622700";
    break;
  case "301":
    number = "622262";
    break;
  default:
  }

  for (var j = 0; j < 13; j++) {
    number = number + Math.floor(Math.random() * 10);
  }

  return number;
}
//手机号
  function getMoble() {

    var prefixArray = new Array("130", "131", "132", "133", "135", "137", "138", "170", "187", "189");

    var i = parseInt(10 * Math.random());

    var prefix = prefixArray[i];

    for (var j = 0; j < 8; j++) {

      prefix = prefix + Math.floor(Math.random() * 10);

    }

    var x = document.getElementsByName("mobile_tel");

    for (var i = 0; i < x.length; i++) {

      var o = x[i];

      o.value = prefix;

    }
   return prefix
  }

// 生成
function genrate() {
  var trs = '<tr><td>序号</td><td>姓名</td><td>身份证号码</td><td>银行卡号码</td><td>手机号</td><tr>';
  for (var i = 1; i <= 20; i++) {
    trs += '<tr><td>' + i + '</td><td>' + name() + '</td><td>' + idCard() + '</td><td>' + bankCard() + '</td><td>'+ getMoble() + '</td><tr>';
  }
  $("list").innerHTML = '<table>' + trs + '</table>';
}
genrate();
console 命令行工具 X clear

                    
>
console