how to stop typing in input field code example Example: how to stop type text texbox in javascript $('input').keypress(function(e) { e.preventDefault(); });