Something odd is happening with my HTML object:
<div data-x="1" data-y="1" class="tile empty" style="top: 32px; left: 434px;">
<div class="inner">1:1</div>
</div>
When attempting to access its top
property in jQuery using the code below:
$tile = $('[data-x=1][data-y=1]');
top = parseInt( $tile.css("top") );
And then displaying it with:
console.log(top);
The browser outputs this instead:
Window {postMessage: ƒ, blur: ƒ, focus: ƒ, close: ƒ, parent: Window, …}
I'm puzzled by this behavior, even after removing part of the code from - $img.height()
to top
as it's needed for another element later on.
My expectation was to see 32px returned, which would be parsed and output as 32;