为什么点一下”投注“只会闪一下

问题遇到的现象和发生背景

点投注会发现,会有内容进入文本框,但只闪一下。

问题相关代码,请勿粘贴截图
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        div {
            background: #009933;
            width: 400px;
            height: 300px;
            margin: 0px auto;
            border: 2px dotted #ff3300;
            color: white;
        }
        
        form {
            margin: 0 auto;
        }
        
        table {
            margin: 0 auto;
            font-weight: bold;
        }
        
        .td1 {
            color: black;
        }
        
        .td2 {
            height: 15px;
        }
        
        .td3 {
            width: 10px;
        }
        
        h2 {
            font-size: 28px;
            text-align: center;
        }
    </style>

</head>

<body>
    <div>
        <h2>福利彩票投注助手</h2>
        <form action="">
            <table>
                <tr>
                    <td class="td1">彩票号码</td>
                    <td class="td2">
                        <input type="text" name="x1" id="x1">
                    </td>
                    <td class="">
                        <button onclick="selectnumber('x1')">投注</button>
                    </td>
                    <td class="" rowspan="3">
                        <input type="reset" value="清空">
                    </td>
                </tr>
                <tr>
                    <td class="td1">彩票号码</td>
                    <td class="td2">
                        <input type="text">
                    </td>
                    <td class=""><button></button></td>
                </tr>
                <tr>
                    <td class="td1">彩票号码</td>
                    <td class="td2">
                        <input type="text">
                    </td>
                    <td class=""><button></button></td>
                </tr>
            </table>
        </form>
    </div>
    <script>
        function selectnumber(num) {
            //彩票选号助手
            var number = new Array();
            for (i = 0; i <= 6; i++) {
                number[i] = Math.floor(Math.random() * 30 + 1); //下舍入
            }
            document.getElementById(num).value = 2 //number.join("    ");
                //将数组元素数连接为字符串,中间用空格连接,作为 1 注彩票号码,写入文本框
        }
    </script>
</body>

</html>

运行结果及报错内容
我的解答思路和尝试过的方法

观察到点完投注页面刷新的符号会闪一下

<button onclick="selectnumber('x1')">投注</button>

改为

<input type="button" onclick="selectnumber('x1')" value="投注">
我想要达到的结果

```clojure


```

因为你用了form,把<form去了