title: How can I create a reusable navbar across multiple HTML pages with Bootstrap 5?
body: <p><em>I would prefer a strictly JavaScript way of doing this if possible. Not really wanting to introduce a JavaScript framework into my project.</em></p>
  <pre><code>Layout:
   ./index.html
   ./about.html
   ./crew.html
   ./flights.html
   ./events.html
  </code></pre>
  <p>I want every page to have the same navbar such that I don't have to repeat myself and fix every page every time the order of the links change.</p>
  <p>Here's my example navbar:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;nav class="navbar navbar-expand-xl navbar-light"&gt;
    &lt;button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#toggleMobileMenu" aria-controls="toggleMobileMenu" aria-expanded="true" aria-label="Toggle Navigation"&gt;
      &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
      &lt;/button&gt;
    &lt;div class="collapse navbar-collapse show" id="toggleMobileMenu"&gt;
      &lt;ul class="navbar-nav mx-auto"&gt;
        &lt;li class="nav-item text-center"&gt;
          &lt;a class="nav-link" href="index.html"&gt;Home&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item text-center"&gt;
          &lt;a class="nav-link" href="about.html"&gt;About&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item text-center"&gt;
          &lt;a class="nav-link" href="crew.html"&gt;Crew&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item text-center"&gt;
          &lt;a class="nav-link" href="flights.html"&gt;Flights&lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="nav-item text-center"&gt;
          &lt;a class="nav-link" href="events.html"&gt;Events&lt;/a&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/nav&gt;</code></pre>
  </div>
  </div>
  </p>