dhtmlxMenu usbmenu caption

I am using the following XML to set a menu:

<?xml version='1.0' encoding='iso-8859-1'?>



    

    

    

    

    

        

        

        

        

        





My question is how can I change the caption of a submenu say ‘Help1’ which is under the menu ‘Help’. I tried the following:

var item = amenubar.getItem(“help1_id”);

item.setText(“Help111”);



It gives a javascript runtime error.

The code which you are using is correct,  please be sure that menu already loaded from XML , on moment of command call.
Data loading is async, so calling such command exactly after loadXML command - will not work
The next code can be used

amenubar.loadXML(url,function(){
   // this code will be executed only after data loading
    var item = amenubar.getItem(“help1_id”);

    item.setText(“Help111”);

});