let width = 500;
let height = 420;
let draw = document.createElementNS("http://www.w3.org/2000/svg", "svg");
draw.setAttributeNS(null, "viewBox", "0 0 " + width + " " + height);
draw.setAttributeNS(null, "width", width);
draw.setAttributeNS(null, "height", height);
game.append(draw);
let tail = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
tail.setAttribute('points', '10,10 100,10 55,100');
tail.setAttribute('fill', 'orange');
tail.setAttribute('stroke', 'black');
tail.onclick = function(event) {
alert('1');
};
draw.append(tail);