I want to add the coordinates of a mouse click on a specific element to the end of an array. Below is my code snippet:
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 now includes: " + seatsArray + ".");
Seems like a simple issue, but I'm still new to javascript. Any guidance on why it's not functioning would be highly appreciated!
Thanks