Select a type of pet that you like.

A copy of the JavaScript functions in the head element:

// sample-4-single-select.js
// This sample shows processing of a select list with the default of a single selection

// Reset values onload of the body
function loaded()
  {
  var pet = document.getElementById("pet");
  pet.selectedIndex = 5;  // selects none
  }


// select list onchange handler
function pet_function()
  {
  var pet_list  = document.getElementById("pet");
  var pet_index = pet_list.selectedIndex;
  var result_area = document.getElementById("result");
  result_area.innerHTML = "index: "+pet_index+"   pet: "+pet_list.options[pet_index].value;
  }