Why insertAdjacentHTMLis not working

HTML


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="index.css" />
  </head>
  <body>
    <nav class="navbar">
      <ul class="nav-menu">
        <li class="nav-menu-item"><a href="./index.html">Home</a></li>
        <li class="nav-menu-item">
          <a href="./writeblogs/writeblogs.html">Write Blogs</a>
        </li>
        <li class="nav-menu-item">
          <a href="./contactus/contactus.html">Contact Us</a>
        </li>
      </ul>
      <button class="btn login-btn">
        <a href="./login/login.html">Login</a>
      </button>
      <button class="btn register-btn">
        <a href="./register/register.html">Register</a>
      </button>
    </nav>
    <h1>Blogs</h1>
    <div id="container">
      <h3 class="blog-title">Blog Title</h3>
      <p class="blog-description">Description</p>
    </div>
    <script src="index.js"></script>
  </body>
</html>


Javascript

const blogTitle = document.querySelector(".blog-title");

const blogDescription = document.querySelector(".blog-description");
const body = document.getElementsByTagName("body");
const container=document.getElementsByClassName("container")


fetch("https://node-js-app-with-auth.herokuapp.com/api/blogs")
  .then((res) => res.json())
  .then((data) => {
     const result=
     data.map(ele=>createHTML(ele))
console.log(result.join(","))
     container.insertAdjacentHTML
     
     ("beforeend",result.join(","))
   
  })
  .catch((err) => console.log(err));

const createHTML = function (item) {
  return`<h3>${item.title}</h3>
    <h3>${item.author}</h3>
    <p>${item.body}</p>`;
    
};

I should reading more about the document.getElementsByClassName on MDN. Pay close attention to the return value of this method.

Since the element you are trying to target has an id attribute, why not use a method (there are a couple) that allows you to target the id directly.