Get current menu item label for specific parent menu [closed]

Add the following empty div where you want to display current menu label

<div class="menu-label-container"></div>  

and add the following script in footer of the page.

jQuery(document).ready(function(){
    if(jQuery('#nav li.current-menu-item  a').html())
        jQuery('.menu-label-container').html(jQuery('#nav li.current-menu-item  a').html());       
});

Tell me whether this solution is working for you or i will find another solution.

error code: 523