I have this for my navbar
:
<div class="dropdown">
<a href="#header" class="smoothScroll" class="dropdown">Company</a>
<div class="dropdown-content">
<a href="index.html#about">About Us</a>
<a href="site-pictures.html">Portfolio</a>
<a href="team.html">Leadership Team</a>
</div>
</div>
and what I want to do is put it on all of my pages, so i want to create like a component, where i can then place it in every page without copying line for line. like react.
so i will do this:
navbar = {
<div class="dropdown">
<a href="#header" class="smoothScroll" class="dropdown">Company</a>
<div class="dropdown-content">
<a href="index.html#about">About Us</a>
<a href="site-pictures.html">Portfolio</a>
<a href="team.html">Leadership Team</a>
</div>
</div>
}
then i want to put the navbar
component into each page. is this possible using html?
here is what I tried with help from comment:
<li>
<div id="side-bar"></div>
<script>
document.getElementById("side-bar").innerHTML = <div class="dropdown"> <a href="#header" class="smoothScroll" class="dropdown">Company</a> <div class="dropdown-content"> <a href="index.html#about">About Us</a> <a href="site-pictures.html">Portfolio</a> <a href="team.html">Leadership Team</a> </div> </div>
</script>
</li>