I'm attempting to dynamically expose deeper levels of navigation by injecting html into empty divs. While the html is being successfully injected into the 2nd nav level, I can not get the html to inject into the 3rd level div. I believe that the problem exists because the event listener is ignoring the dynamically generated content, but I can't figure out a way to fix it. Below is the JS. I have also provided a simple jsfiddle of what I am trying to accomplish. Click the blue links to expose each successive level of navigation. It fails at the 2nd level. http://jsfiddle.net/22qQt/17/
$('#L1A').click(function () {
$('#L2 > div.menuWrap > ul.menuItems').html('<li class="navTitle">Campus Life</li><li class="item">Overview</li><li class="link" id="L1A-2A">Housing</li><li class="link" id="L1A-2B">Fitness & Recreation</li><li class="link" id="L1A-2C">Health Services</li><li class="item">Campus Library</li><li class="item">Life in Philly</li><li class="item">Activities Office</li><li class="item">Student Life Office</li>');
});
$('#L1A-2A').click(function () {
$('#L3 > div.menuWrap > ul.menuItems').html('<li class="navTitle">Housing</li><li class="item">Overview</li><li class="item">Policies</li><li class="item">Renters Insurance</li><li class="item">Move-In Day</li>');
});
By the way - I know there is probably a better, less hacky way to inject all that html. However, it's only for a prototype and at this point I don't have the time to figure out a better way.