<style> #rect0{ position:relative; width:100px; height:100px; } #rect0 p{ margin:20px; background-color:#89e887; width:60px; height:60px; } </style> $('#btn0').click(function(){ $('#input0').val( $('#rect0').position().top ); $('#input1').val( $('#rect0').position().left ); $('#input2').val( $('#rect0').offset().top ); $('#input3').val( $('#rect0').offset().left ); $('#input4').val( $('#rect0 p').