Random ID in jQuery

To create randomly id for elements of html we mostly use jQuery. Here is some code function in jQuery that creates random id for elements

 function generateID()
var randLetter = String.fromCharCode(65 + Math.floor(Math.random() * 26));
var unique_id = randLetter + Date.now();
return randLetter+unique_id;

Leave a Reply

Your email address will not be published. Required fields are marked *