Search notes:

DOM example: document.getElementsByTagName

document.getElementsByTagName('div') returns an array of nodes (a HTMLCollection) whose HTML element is <div>.
<!DOCTYPE html>
<html>
<head>
  <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
  <title>getElementsByTagName</title>

  <script type="text/javascript">
    
     function main() { 
       try {
         var node_list = document.getElementsByTagName('body');

           node_list[0].innerHTML = "This is the body element";
     
       } catch(e) {alert (e);}
     }

  </script>

</head>
<body onload='main();'>
</body>
</html>
Github repository about-Document-Object-Model, path: /Node/Document/getElementsByTagName.html

See also

Two elements can be referenced more directly:
document.getElementById('…') returns the (single) element, if it exists, whose attribute id has a given value.
document.getElementsByName('abc') returns an array of elements whose name attribute is abc.
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...', 1758207382, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/web/DOM/examples/Node/Document/getElementsByTagName(74): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78