I want to print the values of an array that are pushed when I click an object. The function works because the alerts appear. The problem is that it does not print the values in the html paragraph.
var x1;
var y;
shape.onclick = function(){
var name=this.id;
alert(name);
x1=this.getAttributeNS(null, "cx");
y=this.getAttributeNS(null, "cy");
alert(y);
namecirc=push(name);
positionX=push(x1);
positionY=push(y);
document.getElementById("demo").innerHTML ="x="+positionX;
};
html:
<p id="demo"></p>