onload事件支持的标签||onload设置有些标签无用

支持的标签:<body>, <frame>, <iframe>, <img>, <input type="image">, <link>, <script>, <style>
成功测试使用的标签:<body>, <style>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Login</title>
    <meta name="description" content="向客户们真实的呈现菜品,方便食客们的浏览">
    <meta name="author">


    <script type="text/javascript">

       var a=10

        function fun2() {
            console.log("我得到了交代你")
        }
       function fun() {
           document.getElementById("one").focus();
           console.log("onehaha")
       }
    </script>

</head>

<body onload="fun()" >

    <div class="box" style="margin: auto" >
        <h2>欢迎光临</h2>
<input id="one" type="text">
        <style onload="fun()"></style>

            <form action="login" method="post">

                <div class="input_box">
                    <p>账号&nbsp&nbsp<input id="userName" class="text" type="text" name="userName" placeholder="用户账号"   onfocus="fun2()"></p>
                </div>
                <div id="error_box1" calss="error"></div>
                <div class="input_box">
                    <p>密码&nbsp&nbsp<input id="password" class="text" style="color: #FFFFFF !important" style="color: #FFFFFF !important" class="text" type="password" name="password" placeholder="用户密码"></p>
                </div>

                <div class="input_box1">
                    <!-- <button type="submit" class="btn1" onclick="return validateCode()">登录</button> -->
                    <input type="submit" class="btn1" value="登录"  />
                </div>


            </form>
        </div>
    </div>
<script type="text/javascript">
    console.log("one")

</script>
</body>

</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值