Home » Php » php – nested menu not working click on sub-menu main menu get collaps

php – nested menu not working click on sub-menu main menu get collaps

Posted by: admin February 25, 2020 Leave a comment

Questions:

I am trying to use a nested dropdown list, unfortunately, it is collapsing the main <li> tag only it’s not working properly here is the code:

<li class="nav-item">
  <a class="nav-link collapsed" data-toggle="collapse" href="#page12" aria-expanded="false" aria-controls="page12">
    <span class="menu-title">student 1</span>
    <i class="menu-arrow"></i>
    <i class=" mdi mdi-chemical-weapon "></i>
  </a>
  <div class="collapse" id="page12">
    <ul class="nav flex-column sub-menu">
      <li class="nav-item"> <a class="nav-link" href="#link">Add </a></li>
      <li class="nav-item"> <a class="nav-link" href="#link">Update </a></li>
      <li class="nav-item"> <a class="nav-link" href="#link">View </a></li>
      <li class="nav-item">
        <a class="nav-link collapsed" data-toggle="collapse" href=".abc" aria-expanded="false" aria-controls="page123">
          <span class="menu-title">student 2</span>
          <i class="menu-arrow"></i>
          <i class=" mdi mdi-chemical-weapon "></i>
        </a>
        <div class="collapse abc" id="page123">
          <ul class="nav flex-column sub-menu">
            <li class="nav-item"> <a class="nav-link" href="#link">Add </a></li>
            <li class="nav-item"> <a class="nav-link" href="#link">Update </a></li>
            <li class="nav-item"> <a class="nav-link" href="#link">View </a></li>

          </ul>
        </div>
      </li>


    </ul>
  </div>
</li>

student 1 menu in that student 2 is sub-menu when I click on student 2 the student 1 get collaps student 2 is not displaying its content

How to&Answers: