---恢复内容开始---

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>循环处理操作</title>
        <script type="text/javascript">
        /*
            window.onload=iniAll;
            function iniAll(){
                for(var i=0;i<24;i++){
                    var newnum=Math.floor(Math.random()*75)+1;
                    document.getElementById("square"+i).innerHTML=newnum;
                }
            }
            */
        //代码改进  主要通过传参
        /*
        window.onload=iniAll;
        function iniAll(){
            for (var i=0;i<24;i++) {
                setSquare(i);
            }
        }
        function setSquare(thisquare){
            var currsquare="square"+thisquare;
            var newnum=Math.floor(Math.random()*75)+1;
            document.getElementById(currsquare).innerHTML=newnum;
        }*/
        //探测对象。。。
        /*
        window.onload=iniAll;
        function iniAll(){
            if(document.getElementById){
                for (var i=0;i<24;i++) {
                    setSquare(i);
                }
            }
            else{
                alert("not support")
            }
        }
        function setSquare(thisquare){
            var currsquare="square"+thisquare;
            var newnum=Math.floor(Math.random()*75+1);
            document.getElementById(currsquare).innerHTML=newnum;
        }*/
        //限制没一列的 值
        window.onload=iniAll;
        function iniAll(){
            if(document.getElementById){  
                for (var i=0;i<24;i++) {
                    setSquare(i);
                }
            }
            else{
                alert("not support")
            }
        }
        function setSquare(thisquare){
            var currsquare="square"+thisquare;
            var colplace=new Array(0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,4);
            var colbasis=colplace[thisquare]*15;
            var newnum= colbasis+Math.floor(Math.random()*15+1);
            document.getElementById(currsquare).innerHTML=newnum;
        }
        </script>
        <style type="text/css">
            body{
                background: #CCCCCC;
                color: black;
                font-size: 20px;
                font-family: "arial, helvetica, sans-serif";
            }
            #free{
                background: #fff;
            }
            h1{
                font-size: 28px;
                font-family: "微软雅黑";
            }
            table{
                border-collapse: collapse;
            }
            th td{
                padding: 10px;
                border: 2px #555 solid;
                text-align: center;
                width: 40%;
            }
            
        </style>
    </head>
    <body>
        <h1>my bingo</h1>
        <table border="" cellspacing="" cellpadding="">
            <tr>
                <th>B</th>
                <th>i</th>
                <th>n</th>
                <th>g</th>
                <th>o</th>
            </tr>
            <tr>
                <td ></html>

---恢复内容结束---

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>循环处理操作</title>
        <script type="text/javascript">
        /*
            window.onload=iniAll;
            function iniAll(){
                for(var i=0;i<24;i++){
                    var newnum=Math.floor(Math.random()*75)+1;
                    document.getElementById("square"+i).innerHTML=newnum;
                }
            }
            */
        //代码改进  主要通过传参
        /*
        window.onload=iniAll;
        function iniAll(){
            for (var i=0;i<24;i++) {
                setSquare(i);
            }
        }
        function setSquare(thisquare){
            var currsquare="square"+thisquare;
            var newnum=Math.floor(Math.random()*75)+1;
            document.getElementById(currsquare).innerHTML=newnum;
        }*/
        //探测对象。。。
        /*
        window.onload=iniAll;
        function iniAll(){
            if(document.getElementById){
                for (var i=0;i<24;i++) {
                    setSquare(i);
                }
            }
            else{
                alert("not support")
            }
        }
        function setSquare(thisquare){
            var currsquare="square"+thisquare;
            var newnum=Math.floor(Math.random()*75+1);
            document.getElementById(currsquare).innerHTML=newnum;
        }*/
        //限制没一列的 值
        window.onload=iniAll;
        function iniAll(){
            if(document.getElementById){  
                for (var i=0;i<24;i++) {
                    setSquare(i);
                }
            }
            else{
                alert("not support")
            }
        }
        function setSquare(thisquare){
            var currsquare="square"+thisquare;
            var colplace=new Array(0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,4);
            var colbasis=colplace[thisquare]*15;
            var newnum= colbasis+Math.floor(Math.random()*15+1);
            document.getElementById(currsquare).innerHTML=newnum;
        }
        </script>
        <style type="text/css">
            body{
                background: #CCCCCC;
                color: black;
                font-size: 20px;
                font-family: "arial, helvetica, sans-serif";
            }
            #free{
                background: #fff;
            }
            h1{
                font-size: 28px;
                font-family: "微软雅黑";
            }
            table{
                border-collapse: collapse;
            }
            th td{
                padding: 10px;
                border: 2px #555 solid;
                text-align: center;
                width: 40%;
            }
            
        </style>
    </head>
    <body>
        <h1>my bingo</h1>
        <table border="" cellspacing="" cellpadding="">
            <tr>
                <th>B</th>
                <th>i</th>
                <th>n</th>
                <th>g</th>
                <th>o</th>
            </tr>
            <tr>
                <td ></html>

相关文章:

  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-21
  • 2021-11-17
  • 2022-01-27
  • 2021-09-24
  • 2022-12-23
  • 2022-01-21
  • 2022-01-14
相关资源
相似解决方案