0
var canvas = document.createElement('canvas'), canvasContext = canvas.getContext('2d');
canvas.width = image.width;
canvas.height = image.height;
canvas.id = ;
canvasContext.drawImage(image, 0, 0);
container.append(canvas);

how can I give all my generated canvas' unique ID's

Steven
  • 2,547
  • 2
  • 14
  • 7

1 Answers1

0

Can't you just add a counter?:

var counter = 0;
...
canvas.id = 'something_' + counter;
...
counter++:

Or to you mean unique unique?

Jarrod
  • 9,349
  • 5
  • 58
  • 73
  • yes this works but I probably was not clear enough i want the Id's to stick with these methods the id changes on fresh I want an unique id as in different for others but not unique as in random, if that makes sense – Steven Apr 14 '13 at 22:12
  • Sorry Bro, still don't get it. – Jarrod Apr 14 '13 at 22:22