Blogger Information
Blog 18
fans 0
comment 0
visits 13973
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第4期学习班-1.16作业-【javascript基础】
八七乱乱
Original
532 people have browsed it

实例1.javascript基础

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>javascript基础</title>

</head>
<body>
<h2 id="header" style="color: blueviolet" onclick="alert(this.id)">草台班子学习频道</h2>
<h2 id="header" style="color: blueviolet" onclick="alert(id)">草台班子学习频道</h2>
<form action="">
    <input name="ban" type="text" value="草台班子">
    <button onclick="alert(ban.value)">显示内容</button>
    <br>
    <input name="username" type="text" placeholder="用户名">
    <button onclick="check(username)">验证表单</button>
    <script>
        function check(username) {
            if(username.value.length===0){
                alert('用户名空空如也')
            }else{
                alert('验证通过,您输入的内容是:'+username.value)
            }

        }
    </script>

</form>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

 

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments