moose
unread,Jan 3, 2011, 6:44:26 AM1/3/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Closure Library Discuss
Hi,
I am trying to get a root tri-state-checkbox work with some normal
checkboxes. Its always only one root checkbox, but the number of leaf-
checkboxes can vary:
<div><span id="root"></span> Select/Deselect All</div>
<div id="AllNormalCheckboxes">
<label for="c1">Label 1</label><input type="checkbox" id="c1"/>
<label for="c2">Label 2</label><input type="checkbox" id="c2"/>
<label for="c3">Label 3</label><input type="checkbox" id="c3"/>
...
<label for="c12">Label 12</label><input type="checkbox" id="c12"/>
</div>
My script works fine if I use span-tags instead of input-tags, but I
can't be sure if JavaScript is enabled. So I have to use input-tags.
I could use goog.dom.getElement('c1').checked; and
goog.dom.getElement('c1').checked=true instead of getChecked() and
setChecked(). Is this the best way to do so?
Thanks in advance,
Martin