I'm facing an issue with my Django project while working on a template. I want to toggle the visibility of a div element between hiding and showing, but the function I used isn't working for some reason. I borrowed the function from a different template where it worked fine, but now in my Django project, it's not functioning properly. I've been stuck trying to find a solution to this problem. Here is the template code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Admin Home Page</title>
{% load staticfiles %}
<!-- Bootstrap core CSS -->
<link href="{% static 'Boards/Homepage/vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Sofia' rel='stylesheet'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="{% static 'Boards/Homepage/css/modern-business.css' %}" rel="stylesheet">
<style>
#ManageUsers {
display: none;
}
</style>
<script type="text/javascript">
function ToggleHide(id) {
var divelement = document.getElementById(id);
if (divelement.style.display === 'none')
divelement.style.display = 'block';
else
divelement.style.display = 'none';
}
</script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar fixed-top navbar-expand-lg fixed-top" style="background-color: #0b0849;">
<div class="container">
<a class="navbar-brand" href="#" style="margin-left: -120px; font-family: 'Sofia';font-size: 22px;" ><i class="fa fa-flash" style="font-size:24px"></i> Drello Admin</a>
<div class="search-container">
<form action="/action_page.php">
<input type="text" placeholder="Search.." name="search">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li>
<a class="navbar-brand" href="index.html"><i class="fa fa-home" style="font-size:24px;"></i> Home</a>
</li>
<li class="nav-item dropdown" style="margin-right: -120px;">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownBlog" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> My Profile</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownBlog">
<a class="dropdown-item" href="full-width.html" style="color: #0b0849; margin-bottom: 10px;"><i class="fa fa-user-circle"></i> Profile</a>
<a class="dropdown-item" href="full-width.html" style="color: #0b0849; margin-bottom: 10px;"><i class="fa fa-user-plus"></i> Add User</a>
<a class="dropdown-item" href="sidebar.html" style="color: #0b0849; margin-bottom: 10px;"><i class="fa fa-bell"></i> Sidebar Page</a>
<a class="dropdown-item" href="#" style="color: #0b0849; margin-bottom: 10px;"><i class="fa fa-power-off"></i> Logout</a>
</div>
</li>
</ul>
</div>
</div>
</nav>
<br>
<br>
<!-- Page Content -->
<div class="container">
<!-- Page Heading -->
<h2 class="my-4" style="margin-left: -50px; font-size: 16px; font-weight: 700; display: inline-block; color: #0b0849;"><i class="fa fa-address-book-o"></i><a href = "" onclick="ToggleHide('ManageUsers');"> Manage Users </a> </h2>
<div class="row" style="margin-left: -45px;">
<div class="col-lg-3 col-md-4 col-sm-6 portfolio-item">
</div>
</div>
<div id="ManageUsers">
<table style="width:50%">
<tr>
<th>User Name</th>
</tr>
<tr>
<td>Zeinab Awada</td>
<td><a href = "#" > <button>Edit User</button></a><td>
</tr>
<tr>
<td>Mahdi Jaber </td>
<td><a href = "#" > <button>Edit User</button></a><td>
</tr>
</table>
</div>
<div class="container">
<!-- Page Heading -->
<h2 class="my-4" style="margin-left: -40px; font-size: 16px; font-weight: 700; display: inline-block; color: #0b0849; padding-top: 20px;"><i class="fa fa-bars"></i> <a href = "" onclick="ToggleHide('ManageUsers');"> Manage Boards</a></h2>
</div>
</div>
<!-- /.container -->
<!-- Bootstrap core JavaScript -->
</body>
</html>