fengchuanyu 16 цаг өмнө
parent
commit
1b365c00a7

+ 39 - 0
6_HTML5/1_新增表单元素.html

@@ -0,0 +1,39 @@
+<!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>
+    <form action="xxx.php">
+        <input type="text">
+        <!-- 数字文本框 -->
+        <input type="number" max="10" min="1" step="2">
+        <input class="color-inp" type="color">
+        <input type="date">
+        <!-- <input type="datetime"> -->
+        <input id="range-inp" type="range">
+        <!-- <input name="phone" type="tel"> -->
+         <input type="url">
+        <input type="email">
+
+        <button id="btn" type="">按钮</button>
+    </form>
+
+    <script>
+        var oId = document.getElementById("btn");
+        var oColor = document.getElementsByClassName("color-inp")[0];
+        var rangeInp = document.getElementById("range-inp");
+
+        oId.onclick = function () {
+            // console.log(oColor.value)
+            console.log(rangeInp.value);
+
+        }
+    </script>
+</body>
+
+</html>

+ 12 - 0
6_HTML5/2_语义化标签.html

@@ -0,0 +1,12 @@
+<!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 class="header">头部</div>
+    <div class="nav">导航</div>
+</body>
+</html>

+ 33 - 0
6_HTML5/3_媒体标签.html

@@ -0,0 +1,33 @@
+<!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>
+    <!-- audio 音频标签 -->
+    <!-- <audio src="./media/song.mp3" controls></audio>
+      -->
+    <audio id="mp3" src="./media/song.mp3" autoplay></audio>
+    <!-- <audio autoplay>
+        <source src="./media/song.mp3">
+    </audio> -->
+    <button id="play-btn">播放</button>
+    <button id="paused-btn">暂停</button>
+
+    <video src="./media/media.mp4" controls></video>
+    <script>
+        var playBtn = document.getElementById("play-btn");
+        var pausedBtn = document.getElementById("paused-btn");
+        var oMp3 = document.getElementById("mp3");
+
+        playBtn.onclick = function(){
+            oMp3.play();
+        }
+        pausedBtn.onclick = function(){
+            oMp3.pause();
+        }
+    </script>
+</body>
+</html>

BIN
6_HTML5/media/media.mp4


BIN
6_HTML5/media/song.mp3