jQuery
Prevent Space in the input field
![](https://blog.codehunger.in/wp-content/uploads/2022/08/prevent-space-in-the-input-field_328.jpg)
Html input tag
<input type='text' name="users" />
Simply add this line of code into your HTML pages scripts
$('input').keypress(function( e ) { if(e.which === 32) return false; });
Html input tag
<input type='text' name="users" />
Simply add this line of code into your HTML pages scripts
$('input').keypress(function( e ) { if(e.which === 32) return false; });
Don't think too much let's begin.