Hi
I need to add or remove a menu item depending upon some comdiitons in javascript. I found no trouble finding menu object in javascript, I was able to remove an item as well with the help of
menu._childListElement.removeChild(menu._childListElement.childNodes[4]);
but I could not find a way to add a menu item into it. There are functions like apendchild(child), but I am not able to figure out first how to create a child to pass that as parameter.
Is there a way to do add an item?
I need to add or remove a menu item depending upon some comdiitons in javascript. I found no trouble finding menu object in javascript, I was able to remove an item as well with the help of
menu._childListElement.removeChild(menu._childListElement.childNodes[4]);
but I could not find a way to add a menu item into it. There are functions like apendchild(child), but I am not able to figure out first how to create a child to pass that as parameter.
Is there a way to do add an item?