Hi,
 
I'm just starting experimentation with javascript, here is an attached html file to illustrate my post, the idea is to have a simple DOM compliant manipulable menu base on <ul> and <li> tags.
I've defined 2 function:
    hideChilds(elm) wich take an elements and hide all the child tags elements
    showChilds(elm) that does the oposite of hideChilds
 
Currently 2 problems occurs:
    -I'm unable to replace accurately the onclick event of the 'elm' parameters of my functions
    -clicking on a child <li> fire onclick of parent <li>
 
so two questions:
    -how can I set the elm.onclick property (should I call it a property???) to call the oposite function?
    -how can I avoid onclick event of parents elements (try clicking on a submenu item)
 
I've added an alert at the end of each functions as checking purpose
I've commented my last instruction that reaffect the elm.onclick property
 
Thanks alot for any hint
 
Gauthier
  • menu1
  • menu2
    • submenu 2-1
    • submenu 2-2
    • submenu 2-3
      • submenu 2-3-1
      • submenu 2-3-2
      • submenu 2-3-3
  • menu3

Reply via email to