I have a cascading menu with the following flow;
- click on an item from menu-1
- creates and updates menu-2
li
elements - click on an item from menu-2
creates and updates menu-3
li
elementsetc..
```
$firstMenu = $('.prime-menu');
$secondtMenu = $('.second-menu');
$thirdMenu = $('.third-menu');
```
As i'm traversing through different elems. within each menu, using find()
comes as a blessing, the issue is that the script loads when no menu other than the first menu is created so $secondtMenu.find('.item-year').click(function (clickEvent) {})
is 0 length.
What are my options in JQuery to make my find()
functions work on elements that are not loaded yet in the DOM?
I thought of creating an event listener, but I think there are more terse approaches than that.