[Javascript] how can change select's options dynamic

Dan Costea costea.dan at ssi-schaefer.ro
Mon Oct 14 01:12:37 CDT 2002


here is an example:


<html>
<head>
<script type="text/javascript">
 function testing ()
 {
  myCombo.selectedIndex = 4;
 }
</script>
</head>
<body>
 <center>
  <button onclick="testing ();">just testing</button>
  <select id="myCombo">
   <option>zero</option>
   <option selected>one</option>
   <option>two</option>
   <option>three</option>
   <option>four</option>
   <option>five</option>
  </select>
 </center>
</body>
</html>

If you want more about HTML "select" object, look on the documentation (this is for IE):
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/select.asp
  ----- Original Message ----- 
  From: piaohw 
  To: javascript at LaTech.edu 
  Sent: Monday, October 14, 2002 2:48 AM
  Subject: [Javascript] how can change select's options dynamic


  hi:

     I want change select's options dynamic without refresh page,but I don't know how to.If the function like this can realize,if you know ,please tell me .Thanks!



    Steven Piao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20021014/90401b49/attachment.htm>


More information about the Javascript mailing list