I want to know how to get the X and Y position of HTML elements such as img and div in JavaScript relative to the browser window.
img
div
Get position of div in respect to left and Top
var elm = $('#div_id'); //get the div var posY_top = elm.offset().top; //get the position from top var posX_left = elm.offset().left; //get the position from left