Search notes:

DOM example: clientHeight-Width

<!DOCTYPE html>
<html>
<head>
  <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
  <title>style</title>

  <style type="text/css">
    #t {
      position: absolute;
      top: 150px;
      left: 150px;
      font-size:4em;
      font-family: Courier;
/*    visibility: hidden; */
      height: auto;
      width: auto;
    }
  </style>

</head>

  <script type="text/javascript">
    function main() {

       var t   = document.getElementById('t'  );
       var out = document.getElementById('out');

       out.innerHTML = 'Dimensions of <b>' + t.innerHTML + '</b>:</br>' +
                       'Width:  ' + t.clientWidth + '<br>' +
                       'Height: ' + t.clientHeight;

    }
  </script>

<body onload='main();'>

  <div id='t'>Foo Bar baz</div>

  <div id='out'></div>

</body>
</html>

Github repository about-Document-Object-Model, path: /Node/Element/clientHeight-Width.html

See also

Programming for a web browser: Coordinates of the window, screen and Element object (etc)
DOM examples

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759407975, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/web/DOM/examples/Node/Element/clientHeight-Width(83): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78