Home  »  CodeGuidesLibrariesProgrammingSnippetsTechnology   »   How to Disable Keyboard Input in JavaScript

How to Disable Keyboard Input in JavaScript

Posted: October 3, 2022 | by Michael Bright

Use this to disable keyboard input in JavaScript:

$('#datepicker').keypress(function(event) {
   event.preventDefault();
   return false;
});

Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.

e="text/javascript" src="/wp-content/plugins/the-events-calendar/src/resources/js/views/breakpoints.min.js" id="tribe-events-views-v2-breakpoints-js">