If a user is clicking on a button or link, how do I capture the classname and ID of that link? What if the class name is in a parent element of that link? Example:
<li><a href="/dir1" id="dir1">Directory 1</a></li>
<li><a href="/dir2" id="dir2">Directory 2</a></li>
I want to know that class was submenu and id was dir1 if first item clicked?