// You could generate an ID using a timer and avoiding duplicates using performance.now(): id = 'id' + performance.now() dup = 'id' + performance.now() console.log(id) console.log(id.replace('.','')) // sexy id console.log(id === dup) // false!