摘要: 使用创建style的方式 btn.addEventListener("click", async () => { const ns = document.createElement("style"); ns.textContent = ` button { color: red; } `; docu 阅读全文
posted @ 2020-10-11 12:16 Ajanuw 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 在表单提交前修改数据,此事件在submit之后 f1.addEventListener("formdata", (e) => { e.formData.append("phone", "xxx"); }) 阅读全文
posted @ 2020-10-11 11:39 Ajanuw 阅读(529) 评论(0) 推荐(0) 编辑
摘要: btn.addEventListener("click", async () => { try { const state = await Notification.requestPermission(); if (state !== "granted") { // Need to request 阅读全文
posted @ 2020-10-11 11:07 Ajanuw 阅读(640) 评论(0) 推荐(0) 编辑
摘要: let lock; btn.addEventListener("click", async () => { try { if (lock) { lock.release(); return; } lock = await navigator.wakeLock.request("screen"); l 阅读全文
posted @ 2020-10-11 10:39 Ajanuw 阅读(595) 评论(0) 推荐(0) 编辑