<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5296.0" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=605302817-01022006><FONT face=Arial
color=#0000ff size=2>Oddly enough this works in IE - does it work in other
browsers as well? </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=605302817-01022006><FONT face=Arial
color=#0000ff size=2>Normally .length is read-only for arrays and
such.</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV class=Section1>
<P class=MsoNormal align=left><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-no-proof: yes"><FONT
face=Verdana></FONT></SPAN><?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p><FONT face=Arial color=#0000ff
size=2><SPAN class=605302817-01022006>james c</SPAN></FONT></P></o:p></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV><FONT face=Arial
color=#0000ff size=2></FONT><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> javascript-bounces@LaTech.edu
[mailto:javascript-bounces@LaTech.edu] <B>On Behalf Of </B>Peter
Brunone<BR><B>Sent:</B> Wednesday, February 01, 2006 10:53 AM<BR><B>To:</B>
javascript@LaTech.edu<BR><B>Subject:</B> Re: [Javascript] deleting all
options<BR></FONT><BR></DIV>
<DIV></DIV><FONT face=arial size=2>Can you still set options.length =
0?<BR><BR>Also, innerHTML = "" comes to mind (this might possibly be fastest,
though not supported by earlier browsers)...<BR><BR>Peter<BR><BR></FONT><FONT
face="Tahoma, Arial, Sans-Serif" size=2><B>From</B>: "Nick Fitzsimons" <A
href="mailto:nick@nickfitz.co.uk">nick@nickfitz.co.uk</A><BR></FONT><BR>> i
dynamically fill a <SELECT> with options depending on an ID given by>
another</SELECT>.<BR>> when i do it twice the first created options still are
in the new select.<BR>><BR>> now i need ans easy function to clear the
<SELECT> of all its options.>> do i have to count through every option
of that select or is there a> faster way?Assuming your select has an id, as
in</SELECT><BR>you can use<BR><BR>// get reference to element<BR>var element =
document.getElementById("mySelect");<BR>// remove all children of
element<BR>while (element.firstChild)
{<BR>element.removeChild(element.firstChild);<BR>}<BR><BR>As you presumably
already have a variable reference to the select,
adjust<BR>accordingly.<BR><BR>The while loop there is a general purpose way of
removing all the child<BR>nodes of any element, so depending on your needs, you
may find it useful<BR>to move it into a function.<BR><BR>HTH,<BR><BR>Nick.<BR>--
<BR>Nick Fitzsimons<BR><A
href="http://www.nickfitz.co.uk/">http://www.nickfitz.co.uk/</A> </BODY></HTML>