Underscore.js 1.7の使い方 Utility編 uniqueId

var r = document.getElementById("r");
for(var i=0; i<5; i++) {
  r.innerHTML += _.uniqueId('id') + ' ';
}