Get top : offset « jQuery « JavaScript Tutorial






<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            var b = $("b:last");
            var offset = b.offset();
            alert(offset.left);
            alert(offset.top);

        });
    </script>
  </head>
  <body>
    <body>
      
       <b>Hello asdf asdf</b>
    </body>
</html>








30.72.offset
30.72.1.Get offset
30.72.2.Get top
30.72.3.Output tag and coordinates
30.72.4.offset(): returned object contains two Integer properties, top and left. (works only with visible elements)