I'm trying to create a lis for which every time the code is executed, it appends the new values to the end of the list. I've tried the following, and it does'nt work. Can someone provide suggestions. (for some reason it always equals null?)
if(listXY == null)
{
alert("list eq null");
var listXY=clickedX+","+clickedY;
}
else
{
alert("list eq summit");
listXY=","+listXY+","+clickedX+","+clickedY;
}
if(listXY == null)
{
alert("list eq null");
var listXY=clickedX+","+clickedY;
}
else
{
alert("list eq summit");
listXY=","+listXY+","+clickedX+","+clickedY;
}