How To Attach Event on Parent Menu?

Hi There,

I’ve a code like this

menu.attachEvent('onClick',menuAct);

function menuAct(id){
  alert('Ur clicked menu with id : '+id);
}

I want to attach onClick event on Parent Menu, is it possible? I’ve tried this code, but only works with child menu, not the parents.

Hi
There next code works:

function doOnLoad(){ menu= new dhtmlXMenuObject("divMenu","dhx_skyblue"); menu.loadXML("../___xml/menu.xml"); menu.attachEvent('onClick',menuAct); } function menuAct(id){ console.log('Ur clicked menu with id : '+id); }

May be you put function in incorrect places?