Solution 1 :

Set z-index: 1 to fetchlist div.

<div id="fetchlist" style="background-color: red;position:absolute; z-index: 1;">

Problem :

I am having problem selecting 3rd item in my list “Puma”.
The problem is when I try to select the item “My Account” come from behind.

I want “My Account” tab remains behind when I select “Nike”, “Reebok”, “Puma”, “Fila”, “Sneaker”

I tried something position abosolute/relative but it did not work for me.

Here is the code:

<link rel="stylesheet" href="" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<script src="" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>

<script src="" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>

<script src="" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

  li.myClassT {
    cursor: pointer;
   li:hover {
    background-color: #ccc;

<nav class="navbar navbar-expand-lg fixed-top navbar-light bg-light" style="padding-top: 0.15rem">

  <a class="navbar-brand" href="#" id="newStoreName">Chaos Fast Food</a>
   <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navb" aria-expanded="true">
    <span class="navbar-toggler-icon"></span>
  <div id="navb" class="navbar-collapse collapse hide">

  <ul class="navbar-nav">

  <div class="container-fluid">

    <form action="detail.php" method="post">
      <div class="row">
        <div class="input-group">
          <!-- type = "search" -->
          <input class="form-control border-secondary py-2 input-lg" type="text" name="search" id="vsearch" value="" placeholder="search for products" autocomplete="off">
          <div class="input-group-append">
            <button class="btn btn-outline-secondary" type="button">
              <i class="fa fa-search"></i>




     <!--  Here is the problem selecting "Puma" the "My Account" comes from behind and "My account" got selected, what I don't want. -->

      <div id="fetchlist" style="background-color: red;position:absolute">
        <ul class="list-unstyled" style="background-color:#eee;cursor:pointer" >



<ul class="nav navbar-nav ml-auto">
  <li class="nav-item">
    <a class="nav-link" href="cart.php"><span class="fa fa-shopping-cart" aria-hidden="true"></span>Cart</a>

    <!-- Dropdown -->

           <!--  Here is the problem selecting "Puma" the "My Account" comes from behind and "My account" got selected, what I don't want. -->

  <li class="nav-item dropdown">
   <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">My Account</a>
    <div class="dropdown-menu dropdown-menu-right">
      <a class="dropdown-item" href="#">Profile</a>
      <a class="dropdown-item" href="#">Orders</a>
      <a class="dropdown-item" href="#">Setting</a>



<!-- fetchlist -->
 $("#fetchlist").on('click','li',function() {



Leave a Reply

Your email address will not be published. Required fields are marked *