I don't know anything about nodeJS, but this is the bit that shows your data in the html:
Code:
element.innerHTML = data.value;
so I guess at that point if you had made a globally-acessible array like this:
then below the innerHTML line you can push the data onto the array:
Code:
mydata.push(data.value)
or initialize a string:
and then add the data to the string:
Code:
mydata+=data.value;
or if you want the var to be overwritten each time data is received (to mirror what is shown in the html)
and then inside socket.on:
depends what you want to do, really