Title
摘要: 1.如何隐藏所有指定的元素 const hide = (el) => Array.from(el).forEach(e => (e.style.display = 'none')); // 事例:隐藏页面上所有`<img>`元素? hide(document.querySelectorAll('im 阅读全文
posted @ 2022-02-17 15:31 谈亦行 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 1、复制到剪贴板 使用 navigator.clipboard.writeText 轻松将任何文本复制到剪贴板。 const copyToClipboard = (text) => navigator.clipboard.writeText(text); copyToClipboard("Hello 阅读全文
posted @ 2022-02-17 14:42 谈亦行 阅读(42) 评论(0) 推荐(0) 编辑