gpt4 book ai didi

html - 禁用文本选择和复制

转载 作者:行者123 更新时间:2023-11-28 03:06:22 25 4
gpt4 key购买 nike

我正在尝试禁用文本选择和文本复制。我使用了下面的 css

.noselect {
-webkit-touch-callout: none !important;
-webkit-user-select: none !important;
-khtml-user-select: none !important;
-moz-user-select: none !important;
-ms-user-select: none !important;
-o-user-select: none !important;
user-select: none !important;
}
<p>Selectable Text below</p>
<p class="noselect">Unselectable Text but when I Ctrl+A and Ctrl+C, it still copies.</p>
<p>Selectable Text above</p>

用户无法选择文本,但在全选时,用户可以复制所有文本。有什么想法吗?

最佳答案

你可以阻止用户点击 ctrl+a 注意这个片段

$(function(){   
$(document).keydown(function(objEvent) {
if (objEvent.ctrlKey) {
if (objEvent.keyCode == 65) {

return false;
}
}
});

关于html - 禁用文本选择和复制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32477679/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com