I want to use the value inside a function outside of it. I have the global variable, and since it is a variable that is never the same, it presents it. I tested this, and only ran once with the undifined value, because the function was not executed.
var circle_x;
function deselectElement(evt){
if(selectedElement != 0){
selectedElement.parentNode.removeAttributeNS(null, "onmousemove");
selectedElement.removeAttributeNS(null, "onmouseup");
selectedElement = 0;
dx=evt.clientX;
//objet 1
if(selectedLineX == 1){
circle_x=currentX;
}
}
}
alert(circle_x);