[jQuery] Getting link ID
[jQuery] Getting link ID
Hi Guys
i have a click event on my links. Each link has an ID. Is there any
way I can get the link ID when the user clicks it ? See below for
code:
<a id="menu_home" href="#Home"></a>
<a id="menu_contact" href="#Contact"></a>
//JS
$(document).ready(function() {
// Add menu event listeners
var menuItems = ["home", "contact"];
$.each(menuItems, function(intIndex, nm) {
$("#menu_"+nm).click(function () {
getPage(nm+".htm");
});
});
});