I'm using JQuery To load the navbar and body of my website and I want to change the body content onclick some button in the navbar Can I use JavaScript to do that ? how can I ?
Please I been looking for a solution but I didn't found anythings . Thanks in advance
html
<header>
<script>
$(function () {
$("header").load("./dist/includes/navbar.html");
});
</script>
</header>
<!-- END of Section NavBar -->
<main>
<script>
$(function () {
$("main").load("./dist/includes/home.html");
});
</script>
</main>
<!-- Section Footer -->
<footer class="footer">
<script>
$(function () {
$("footer").load("./dist/includes/footer.html");
});
</script>
</footer>
I want to chage the home.html loaded file when i click a button with id="nav-link"
Here is a screenshot