I have a menu on the left where all the elements have the same class. I've added the event $('.menuitem').click and also tried several other options, even calling the event based on the div id but without success.
As there aren't any error messages on the browser console, I'm kinda lost on the search for the error. I appreciate if you could help me figure out what the problem is.
HTML:
<div class='mainwindow'> <div class='menupane'> <div id='entity' class='menuitem'><p class='glyphicon glyphicon-triangle-right'>ENTITIES</p></div> <div class='menuitem'><p class='glyphicon glyphicon-triangle-right'>COURSES</p></div> <div class='menuitem'><p class='glyphicon glyphicon-triangle-right'>STUDENTS</p></div> <div class='menuitem'><p class='glyphicon glyphicon-triangle-right'>CLASSES</p></div> <div class='menuitem'></div> </div> <div class='contentpane'></div> </div> DOM:
$(document).ready(function(){ console.log("loaded"); $('.menuitem').click(function(){ console.log("CLICKED 1"); }); $('#entity').click(function(){ console.log("CLICKED 2"); }); $('.menupane').on('click', '.menuitem', function(){ console.log('CLICKED 3'); }); }); As you can see, I tried adding the click event through several methods and I'm not getting it. Thanks a ton for your help.
cssand test...z-index?z-index: -1;in.mainwindow .menupaneCSS