禁止插入文字
你可能不希望用户在输入字段中粘贴从其他地方复制的文本(仔细考虑是否真的要这样做)。通过跟踪事件paste并调用其方法preventDefault()就很容易完成了。
<input type="text"></input>
<script>
const input = document.
禁止插入文字
你可能不希望用户在输入字段中粘贴从其他地方复制的文本(仔细考虑是否真的要这样做)。通过跟踪事件paste并调用其方法preventDefault()就很容易完成了。
<input type="text"></input>
<script>
const input = document.