This is the unordered list:
<ul id="all-categories" class="categories-list nav nav-tabs text-center">
<li class="category" >
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Liquor</a>
<ul id="liquor-category" class="dropdown-menu">
<li><a href="#">Bourbon</a></li>
<li><a href="#">Gin</a></li>
<li><a href="#">Rum</a></li>
<li><a href="#">Tequila</a></li>
<li><a href="#">Vodka</a></li>
<li><a href="#">Whiskey</a></li>
</ul>
</li>
...
</ul
And this is the code I'm using to get the text and use it as a label elsewhere on the page:
var liquor_selected = document.querySelector('#liquor-category');
var selected = liquor_selected.addEventListener('click',function(e){
document.getElementById("category-name-box").innerHTML = "Liquor Sub-Category Here";
});
It prints the generic text, but I'd like it to print the sub-category. A little help please.