如何复制不能复制的HTML文本?
在<body>标签中添加以下代码:
oncontextmenu='return false' 禁止右键
ondragstart='return false' 禁止拖动
onselectstart ='return false' 禁止选中
onselect='document.selection.empty()' 禁止选中
oncopy='document.selection.empty()' 禁止复制
onbeforecopy='return false' 禁止复制
onmouseup='document.selection.empty()'
扩展资料
示例代码如下:
<body leftmargin=0 topmargin=0 oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' onselect='document.selection.empty()' oncopy='document.selection.empty()' onbeforecopy='return false' onmouseup='document.selection.empty()'>
版权说明:Copyright © 广州松河信息科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州松河信息科技有限公司 版权所有