My code is here.

```
    $(document).ready(function() {
        loadMainMenu();
        lessMenu();
    });
    function loadMainMenu() {
        $.getJSON('./inc/main_menu.json', function(data) {
        var html = '';
        html += '<ul>';

        $.each(data, function(entryIndex, entry) {
            if(entry.permission.indexOf(permission) >= 0){          
                if(entry.sub && entry.sub.length > 0) {                     
                    html += '<li class="child nav_box nav_box_padding-all nav_box1';

                    // 현재 페이지 해당 카테고리 클래스 추가 임시 코드
                    if(recentPage == entry.name){
                        html += ' recent';
                    }else if(entry.name == "마이페이지"){
                        html += ' mypage';
                    }
                    html += '"><a class="nav_box_label" href=' + entry.link + ' title=' + entry.permission  + '>' + entry.name + '</a><span class="less">▼</span><span class="more">▲</span><ul>';
                    $.each(entry.sub, function(key, val) {
                        html += '<li><a href=' + val.link + ' title=' + val.permission  + '>' + val.name + '</a></li>';
                    });
                    html += '</ul></li>';                       
                } else {
                    html += '<li><a href=' + entry.link + ' title=' + entry.permission  + '>' + entry.name + '</a></li>';   
                }
            }
        });

        html += '</ul>';
        $("nav").html(html);
        });

        return false;       
    }
    function lessMenu() {
        $("li.nav_box").not(".mypage").children("ul").hide();console.log("ok!");        
    }

```

li.nav\_box is the element that is generated when the page is loaded with jQuery.

I can see ok message on console.

But hide function doesn't work.

When I type manually lessMenu() on console, work well. 

Please give me the advice!