Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb3caeb

Browse files
authored
Preventing paste into an input field
1 parent5d87a65 commitfb3caeb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

‎README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
|28|[Notify when element size is changed](#Notify-when-element-size-is-changed)|
3535
|29|[Detect if Browser Tab is in the view](#Detect-if-Browser-Tab-is-in-the-view)|
3636
|30|[Private class methods and fields](#Private-class-methods-and-fields)|
37-
37+
|31|[Preventing paste into an input field](#Preventing-paste-into-an-input-field)|
3838

3939

4040

@@ -643,6 +643,20 @@ console.log(instance.getPrivateMessage()); //=> Come and learn Js with us
643643
```
644644
645645
646+
**[⬆ Back to Top](#table-of-contents)**
647+
### Preventing paste into an input field
648+
see our codepen: https://codepen.io/JSsnippets/pen/qBbyMoJ
649+
650+
```javascript
651+
652+
constpasteBox=document.getElementById("paste-no-event");
653+
pasteBox.onpaste= (e)=> {
654+
e.preventDefault();
655+
returnfalse;
656+
};
657+
658+
```
659+
646660
647661
648662

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp