This is a little funtion for creating autogenerated Ids
//Declare some variables
var rand
var anotherNumber
var str
var myDate
var strDate
var text
rand= Math.random();
anotherNumber = rand + '';
str = anotherNumber.substr(2,4);
myDate = new Date();
strDate = myDate.getMonth() + '' + myDate.getDate() + '' + myDate.getYear();
text = 'yourResumedEntity'+ strDate + str;
Kind of simple, but worked




![UT 3, 4 & The Milky Way [video] UT 3, 4 & The Milky Way [video]](http://static.flickr.com/2633/4135738280_d16c9dd389_t.jpg)









function uniqid(str)
{
var id = 0;
var flag=true;
while(flag)
{
if(document.getElementById(str + id) == null)
{
return str + id;
flag=0;
}else
id++;
}
}
var id=uniqid(’str’);
i have another solution for elements.