文章编号:123 /
更新时间:2024-12-29 18:31:15 / 浏览:
次
星期一
|
星期二
|
星期三
|
星期四
|
星期五
|
星期六
|
星期日
|
Javascript
// 获取当前时间
const now = new
date();// 获取当前年月
const year = now.getFullYear();
const month = now.getMonth();// 创建日历表头
const table
Head = document.querySelector('thead');
const tableBody = document.querySelector('tbody');// 创建星期表头
for (let i = 0; i < 7; i++) {const th = document.createElement('th');th.textContent = ['星期一', '星期1; i <= 7; i++) {const td = document.createElement('td');td.textContent = '';tableBody.appendChild(td);
}
相关标签:
日历代码html、
日历代码、
本文地址:https://www.qianwe.com/article/b754dad5f0ecd5a3b43a.html
上一篇:JSP源代码下载jsp源代码的时间怎么修改...
下一篇:Javascript中的substring方法javascriptvoi...