I am working on a website which needs to be responsive. I want to convert the navigation into a <select>. There can be any number of <nav> and any number of <ul> inside<nav>. I have used for loops to calculate number of <nav> and <ul> inside <nav>.
One is generating and the other one is not generating, please help me out to resolve this.
It does not work, because you’re looking for
.children('ul')and this only includes immediate descendants, however your secondnavhas adivwrapped around theul…You could change
.childrencall to.findwhich looks for descendants at any depth— CUT HERE —
Alternative solution: