I am using Flask, HTML, CSS, and JS to build a website. I have a navigation bar that has a dropdown menu to other links. You can view the image here- [my navigation image ][1] [1]: https://i.stack.imgur.com/bF6no.png
As you can see it has my submenu but when I click on let's say about, it doesn't redirect me to another page.
Here is my html/js:
<div class="navbar">
<a href="{{url_for('home_page')}}">Home</a>
<div class="subnav">
<button id="myButton" class="subnavbtn">About <i class="fa fa-caret-down"></i></button>
<div class="subnav-content">
<a href="#company">About US</a>
<a href="#company">PCU Vision</a>
<a href="#company">Why PCU?</a>
<a href="#team">Contact</a>
</div>
</div>
<script><script type="text/javascript">
document.getElementById("myButton").onclick = function () {
location.href = "{{url_for('home_page')}}";
};
</script>
I created a function called myButton so when I click on just the About button, it will redirect me to another page, but to no avail?
I am new to HTML and js so any ideas or suggestions would help.