Why setValue() doesn't set the value of a checkbox (and instead adds or removes the 'checked' attribute)?

33 views
Skip to first unread message

xavi.c...@gmail.com

unread,
Aug 11, 2013, 6:38:48 AM8/11/13
to closure-lib...@googlegroups.com
Looking at the code for setValue


I see that for checkboxes, setInputChecked_ is called, and this adds or removes the 'checked' attribute, but leaves any 'value' attribute untouched. I find this unintuitive (and it seems I'm not the only one, as there's a comment in the code of setInputChecked_ saying "This seems potentially unintuitive since it doesn't set the value property"). Besides, given the current behavior and the fact that checkboxes also may have a 'value' attribute, what's the way to change the actual 'value' of the checkbox using the Closure Library?

Xavi


Reply all
Reply to author
Forward
0 new messages