File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 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+ const pasteBox = document .getElementById (" paste-no-event" );
653+ pasteBox .onpaste = (e ) => {
654+ e .preventDefault ();
655+ return false ;
656+ };
657+
658+ ` ` `
659+
646660
647661
648662
You can’t perform that action at this time.
0 commit comments