<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>编辑粘贴逻辑处理</title>
</head>
<body>
<div class="box">11</div>
<p class="content" contenteditable>22</p>
<input type="text" class="enter">
<input type="text" class="enter" value='22'>
<input type="text" class="forbitInput" value='禁止粘贴'>
<script>
window.onload = function () {
var _body = document.getElementsByTagName('body')[0];
_body.addEventListener('paste', function (e) {
js实现编辑粘贴及input输入框禁止粘贴
最新推荐文章于 2024-03-01 21:34:15 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)