Skip to content

Instantly share code, notes, and snippets.

@yokesharun
Created February 8, 2016 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yokesharun/4be5915e6d204d0044ec to your computer and use it in GitHub Desktop.
Save yokesharun/4be5915e6d204d0044ec to your computer and use it in GitHub Desktop.
Generate random Characters with Jquery
function makeid()
{
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < 5; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
// call the function like makeid();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment