Clearing all options from a select
OUCH! I wrote this post to only later learn that doing anything like this:
if (this.selectedDates.length == 0) document.getElementById(this.listName).options[0] = new Option("","");is just dumb. A million times better solution is:
document.getElementById(this.listName).length = 0;Don't you hate when an answer is blindingly obvious? I just figured that length would be read only. Oh well.
0 Comments:
Post a Comment
<< Home