Skip to main content
2 of 2
added 2 characters in body; deleted 94 characters in body
Gabriele Petrioli
  • 197k
  • 35
  • 275
  • 331

Use a regular expression to accomplish this.

function isAlphanumeric( str ) { return /^[0-9a-zA-Z]+$/.test(str); } 
Gabriele Petrioli
  • 197k
  • 35
  • 275
  • 331