⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 13-2.html

📁 js 全的样例代码,比较适合大家学习和交流
💻 HTML
字号:
<html><head><script>// This function displays the time in the status line.// Invoke it once to activate the clock; it will call itself from then on.function display_time_in_status_line(){    var d = new Date();                // Get current time.    var h = d.getHours();              // Extract hours: 0 to 23.    var m = d.getMinutes();            // Extract minutes: 0 to 59.    var ampm = (h >= 12)?"PM":"AM";    // Is it am or pm?    if (h > 12) h -= 12;               // Convert 24-hour format to 12-hour.    if (h == 0) h = 12;                // Convert 0 o'clock to midnight.    if (m < 10) m = "0" + m;           // Convert 0 minutes to 00 minutes, etc.    var t = h + ':' + m + ' ' + ampm;  // Put it all together.    defaultStatus = t;                 // Display it in the status line.    // Arrange to do it all again in 1 minute.     setTimeout("display_time_in_status_line()", 60000); // 60000 ms is 1 minute.}</script></head><!-- Don't bother starting the clock till everything is loaded. The  -- status line will be busy with other messages during loading, anyway. --><body onload="display_time_in_status_line();"><!-- The HTML document contents go here. --></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -