JS DOM: 15. NamedNodeMap

by istiq20

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Named Node Map</title>
  </head>
  <body>
    <img
      id="logo"
      src="https://www.programmerzamannow.com/img/pzn.png"
      alt="PZN Logo"
    />

    <script>
      const logo = document.getElementById("logo");
      const attributes = logo.attributes;

      for (let attribute of attributes) {
        console.info(`${attribute.name} : ${attribute.value}`);
      }
    </script>
  </body>
</html>