I want to show dropdown items in my sidebar when clicked nav-item,I have multiple dropdown nav-item so no matter which one i clicked, i want to get dropdown items to sidebar. when i add another list doesnt work the way i want
This is Html sample i have done
li class="nav-item ">
<button class="nav-link text-dark" onclick="changeNav()" style="white-space:nowrap;border:none;"> @localizer["CourseDefinitions"] @*<span class="caret"></span>*@ </button>
<div id="divcoursedef" class="sidebardashboard" >
<a href="javascript:void(0)" class="closebtn" style="font-size:40px" onclick="closeNav()">×</a>
<a class="fa fa-truck" style="font-size:40px;" asp-area="onepoint" asp-controller="Courses" asp-action="Index"></a>
<br/>
<a class="fa fa-plane" style="font-size:40px;" asp-area="onepoint" asp-controller="Courses" asp-action="MentorCourses"></a>
</div>
</li>
Javascript
<script>
function changeNav() {
document.getElementById("divcoursedef").style.width = "100px";
document.getElementById("conttop").style.marginLeft = "100px";
document.getElementById("contmain").style.marginLeft = "100px";
}
function closeNav() {
document.getElementById("divcoursedef").style.width = "0";
document.getElementById("contmain").style.marginLeft = "0";
document.getElementById("conttop").style.marginLeft = "0";
}
</script>
when I go and apply same formule for other nav-items it doesn't work correct