[FYI: I am not permitted to alter the existing markup. The div will be clicked, not a button or anchor]
I have a menu that needs to comply with accessibility standards and open its submenu upon being clicked.
This onclick function needs to be triggered when the enter key is pressed as well,
// parent menu (will repeat)
<div onclick="javascript:ToggleMenu('Calendar');" class="menu-item" style="cursor: hand;" tabindex="2">
<p>Calendar</p>
</div>
//submenu (will repeat)
<div id="Calendar" class="menu-subitem" style="display: none;" tabindex="2">
<a onclick="Audit(this)" tabindex="2" href="Calendar/CalendarAssignment.aspx" id="TM_C1">Calendar Assignment</a>
<a onclick="Audit(this)" tabindex="2" href="Calendar/ShiftAssignment.aspx" id="TM_C2">Shift Assignment</a>
</div>
Thanks! I have done my best to explain clearly!