Hey guys,
I'm trying to push the coordinates of a mouse click on a particular element to the end of an array. This is what I have:
IN THE HEAD:
var seatsArray = [];
IN THE BODY:
var coordinates = document.getElementById("image");
coordinates.onclick = function(event) {
seatsArray.push(offsetX, offsetY);
}
document.write("Seats array contains: " + seatsArray + ".");
Probably something simple, but I'm new to javascript, so I'd appreciate any help as to why it isn't working!
Thanks