From WikiEducator
Jump to: navigation, search


VmvIcon Objectives.png

By the end of this page you will be able to:

  • Understand how a combo (select) drop box is created

select (js2_03)

<script type="text/javascript">
function fnDisplaySelect() {
  objRef=document.frmChoose.cboNumber; // we are creating an object which means we don't need to key as much on the next line
  alert("You chose the number " + intSelectvalue);
<form name="frmChoose">
  <select name="cboNumber">
    <option value="10">Ten</option>
    <option value="20">Twenty</option>
    <option value="30">Thirty</option>
  <input type="button" value="Display Selection" 
         onClick="fnDisplaySelect()" />

Example :Click here to run js2_03.

VmvIcon References.png References

virtualMV  |  Superquick wiki guide  |  Please give me some feedback

VirtualMV/JavaScript/Forms/Select. (2022). In WikiEducator/VirtualMV wiki. Retrieved August 12, 2022, from http:    (zotero)