Implements a simple event delegation: The click handler is added to an unordered list, and the children of its li children are hidden. Clicking one of the li children toggles (see toggle()) their children.
Edit code and click me
Your Result
(Some examples do not work in Google Chrome):
item 1
sub item 1-a
sub item 1-b
item 2
sub item 2-a
sub item 2-b
Edit the code above and click to see the result
www.xhtml.co.il
- Try it yourself