I have a multilayer drop down navigation bar, which, upon hover opens a menu of subcategories. Upon hovering over these subcategories a further list of subcategories is shown.
Any of the categories, subcategories, and sub-subcategories are supposed to be clickable links, which, when clicked, will show search results for the desired level of detail. i.e. food >>> mexican >>>tacos, One can click on any of the three, to get the desired level of depth in their search.
The problem is, when i click on the subcategories, since they are nested in the parent div, i am also clicking on the parent element.
So if i have:
<ul>
<li onclick="queryfunction()">Category</li>
<ul>
<li onclick="queryfunction()">Sub-Category</li>
<ul>
<li onclick="queryfunction()">Sub-subCategory</li>
</ul>
</ul>
</ul>
Clicking on the bottom category triggers all 3 onclick events.
How can i only trigger the one event i want?