In a previous question I have been given this code and I have a problem that is like being able to show the id of each element created or how to get the id (what happens is that I need to do an if). Canvases are created in the per.
b = [1,2,3,4,5];
$(document).ready(function(){
function per() {
console.log("per()");
var $canvas = $('<canvas></canvas>').css({
'border-radius': '5px',
'padding': '0',
'margin': '0',
'width': '200px',
'height': '200px',
//'position': 'absolute',
'right': '15px',
'bottom': '15px',
'background-color': 'blue'
});
$('body').append($canvas);
}
$('body').append('<canvas id="minimap"></canvas>');
$('#minimap').css({
'background': 'rgba(1,1,1,0.7',
'border-radius': '0px',
'border': '1px solid rgba(255,255,255,0.2)',
'padding': '0',
'margin': '0',
'width': '200px',
'height': '200px',
'position': 'absolute',
'right': '15px',
'bottom': '15px'
});
b.forEach(per);