How to construct a custom html for submenus

Okays.. i’ve solved this in my own way. i have added the following function in functions.php file

class ik_walker extends Walker_Nav_Menu{        
    //start of the sub menu wrap
    function start_lvl(&$output, $depth) {
        $output .= '<div class="dropdownContain">
                        <div class="dropOut">
                            <div class="triangle"></div>
                                <ul>';
    }

    //end of the sub menu wrap
    function end_lvl(&$output, $depth) {
        $output .= '
                    </ul>
                </div>

        </div>';
    }


}

and in the header.php file menu section added this wp_nav_menu

wp_nav_menu( array(
    'container' => false, 
    'menu_id' => 'nav', 
    'depth' => 0,
    'theme_location' => 'primary', 

    'walker' => new ik_walker())
);