Trying to add Global Navigation is the list of navigation links, On click of link want to get the name/ id for the selected list.
I'm getting undefined, Can you please help me on this.
selectedValues(event) { // alert(event.detail.label); // alert(event.target.dataset.id); // alert(event.target.value); alert(event.target.dataset.menuItemId); alert(event.target.name); } <nav class="slds-context-bar__secondary" role="navigation" onclick={selectedValues}> <ul class="slds-grid"> <li class="slds-context-bar__item" data-menu-item-id="Dashboard" data-id="Dashboard"> <a href="javascript:void(0);" class="slds-context-bar__label-action" title="Dashboard" name="Dashboard" data-id="Dashboard" label="Dashboard"> <span class="slds-truncate" title="Dashboard">Dashboard</span> </a> </li> <li class="slds-context-bar__item "> <a href="javascript:void(0);" class="slds-context-bar__label-action" title="Timesheet" name="Timesheet" label="Timesheet"> <span class="slds-truncate" title="Timesheet">Timesheet</span> </a> </li> <li class="slds-context-bar__item "> <a href="javascript:void(0);" class="slds-context-bar__label-action" title="Invoices" name="Invoices" label="Invoices"> <span class="slds-truncate" title="Invoices">Invoices</span> </a> </li> </ul> </nav>