Displaying 1 result from an estimated 1 matches for "toggle_children".
2006 Dec 14
1
Prototype CSS selector to descend tree?
...] Entertainment
[ ] Music
[ ] iTunes
[ ] Winamp
In this menu, if the user clicks on a given checkbox, I want all sub
elements to check as well (and the same on uncheck, obviously).
Since there are all simple checkboxes, I tried attaching this function
to onclick:
function toggle_children (input) {
// locate "input#myid input" (all children)
$$(''input#''+input.id+'' input'').each(function (item) {
if (input.id !== item.id) {
item.checked = input.checked;
}
});
}
But unfortunately, that did not select...