fengchuanyu il y a 2 semaines
Parent
commit
6977ef6364

+ 25 - 0
6-HTML5/2_媒体标签.html

@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <!-- <video src="./media/fly.mp4" autoplay></video> -->
+    <video id="video1">
+        <source src="./media/fly.mp4" type="video/mp4">
+    </video>
+    <button id="btn1">播放</button>
+
+    <audio src="./media/song.mp3" controls></audio>
+    <script>
+        var oVideo = document.getElementById('video1');
+        var oBtn = document.getElementById('btn1');
+
+        oBtn.onclick = function(){
+            oVideo.play();
+        }
+    </script>
+</body>
+</html>

+ 34 - 0
6-HTML5/3_表单标签.html

@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+
+<body>
+    <!-- 日期框 -->
+    <input type="date">
+    <!-- 颜色选择器 -->
+    <input type="color">
+    <!-- 邮箱 -->
+    <form action="xxx.html">
+        <input type="email" name="user-email">
+        <input type="tel" name="user-tel">
+        <input type="submit" value="提交">
+    </form>
+
+    <!-- 数字框 -->
+    <input type="number" min="0" max="100" value="90">
+
+    <input type="range" max="100" min="0" value="90" step="10">
+
+    <!-- 文本框中value 表示默认值 -->
+    <input type="text" value="user">
+    <!-- placeholder 提示文字 -->
+    <input type="text" placeholder="请输入用户名" disabled>
+
+</body>
+
+</html>

+ 62 - 0
6-HTML5/4_控制表单.html

@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <input type="text" id="inp1">
+    <button id="btn">按钮</button>
+    <select  id="school">
+        <option value="heida">黑龙江大学</option>
+        <option value="jiada">佳木斯大学</option>
+        <option value="hgc">黑工程</option>
+    </select>
+
+    <input type="checkbox" id="ck1">
+    <!-- label 标签  用于绑定表单元素  for属性用于绑定表单元素的id -->
+    <label for="ck1">同意</label>
+
+    <script>
+        var oInp = document.getElementById("inp1");
+        var oBtn = document.getElementById("btn");
+        var oSchool = document.getElementById("school");
+        var oCk1 = document.getElementById("ck1");
+
+        oBtn.onclick = function(){
+            // 获取文本框中的内容
+            // var val = oInp.value;
+            // console.log(val);
+            // 给文本框赋值
+            // oInp.value = "123";
+        }
+
+        // 表单事件
+        // 表单输入事件
+        oInp.oninput = function(){
+            console.log(this.value);
+        }
+        // 表单失去焦点事件
+        oInp.onblur = function(){
+            console.log("失去焦点");
+        }
+        // 表单获得焦点事件
+        oInp.onfocus = function(){
+            console.log("获得焦点");
+        }
+
+        // 下拉列表事件
+        // 下拉列表改变事件
+        oSchool.onchange = function(){
+            console.log(this.value);
+        }
+
+        // 复选框事件
+        // 复选框改变事件
+        oCk1.onchange = function(){
+            console.log(this.checked);
+        }
+    </script>
+</body>
+</html>

+ 21 - 0
6-HTML5/5_获取标签.html

@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <div id="box" class="div1">hello</div>
+    <div class="div1">world</div>
+    <script>
+        // 新增选择器 querySelector 获取单个元素 ID 以#开头 class 以.开头
+        // var oBox = document.querySelector(".div1");
+        // console.log(oBox);
+
+        // querySelectorAll 可以获取多个元素
+        var aDiv = document.querySelectorAll(".div1");
+        console.log(aDiv);
+    </script>
+</body>
+</html>

BIN
6-HTML5/media/fly.mp4


BIN
6-HTML5/media/song.mp3