Restrict keyboard character input with jQuery
For validating input, pressed key ASCII code and check it. If you don’t know the ASCII code of a character then you can view it from here and define your condition in keypress Event handler. Example <div class=”container”> <input type=’text’ id=’name’ placeholder=’Enter your name’><br/><br/> <input type=’text’ id=’age’ placeholder=’Enter your age’> </div> <!– Script –> <script> $(document).ready(function(){ $(“#age”).keypress(function(e){ var keyCode […]