topical media & game development

talk show tell print

#javascript-code-20-select.js / js



  // Locate the first <select> menu on the page
  var select = document.getElementsByTagName(“select”)[0];
  
  // Bind a select event listener
  select.onselect = function(){
      // When a new selection is made, redirect the user to its value
      // (which should be a URL)
      window.location.href = this.value;
  };
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.