# 如何实现页面文本不可复制
Issue
欢迎在 Issue 中交流与讨论: Issue 454 (opens new window)
Author
有 CSS 和 JS 两种方法,以下任选其一或结合使用
使用 CSS 如下:
user-select: none;
或使用 JS 如下
document.body.onselectstart = e => {
e.preventDefault();
}
Issue
欢迎在 Issue 中交流与讨论: Issue 454 (opens new window)
Author
有 CSS 和 JS 两种方法,以下任选其一或结合使用
使用 CSS 如下:
user-select: none;
或使用 JS 如下
document.body.onselectstart = e => {
e.preventDefault();
}