Javascript examples for DOM HTML Element:Input Number
Limit characters to Letters and Numbers in input field
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w. j a v a 2 s .c om*/ document.getElementById('input-nickname').onkeyup = function(event) { this.value = this.value.replace(/[^a-z\d]/, ''); } } </script> </head> <body> <input type="text" id="input-nickname"> </body> </html>