Mein Code (die html-Seite):
<nav>
<ul>
<li id="homeLink"><a href="#">Home</a></li>
<li id="rekenLink"><a href="#">Rekenmachine</a></li>
<li id="bakkerLink"><a href="#">Parkeergarage</a></li>
<li id="garageLink"><a href="#">Bij de bakker</a></li>
<ul>
</nav>
Das Javascript/jquery dahinter:
$(function () {
$("ul").click(function () {
// here I want to get the clicked id of the li (e.g. bakkerLink)
});
});
Wie kann ich das tun?