Skip to content Skip to sidebar Skip to footer

Array Slice Returning [object Object] Instead Of Value

I am trying to get the position of a specific div when it is dropped. With some help i have put together the code bellow. I added in the last bit to try and get the specific values

Solution 1:

The problem here is that positionInfois an object, not an array. Time is an array with one such object inside.

I believe you want something like this:

varTime = positions[0];
var x=document.getElementById("posThis");
x.innerHTML= '[' + Time.left + ',' + Time.top + ']';

Post a Comment for "Array Slice Returning [object Object] Instead Of Value"