Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
- <script>
- $(document).on("keypress", function (event) {
- if (event.which !== 0) {
- console.log('blocking keypress event');
- event.preventDefault();
- }
- });
- </script>
- </head>
- <body>
- <div>
- <label>Name: </label><input type="text" id="bef">
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement