Skip to content
Ivan Zugec

Ivan Zugec

Drupal Consultant

  • WebWash (Drupal tutorials)
  • Contact
  • Instagram
  • Twitter
  • LinkedIn
  • GitHub
  • YouTube

Dynamically change select options with JavaScript

If you ever need to change a select box via javascript use the code below.

document.myFormName.mySelectName.options[2] = new Option("label", "value", true);

For more information go herehttp://www.javascriptkit.com/javatutors/selectcontent.shtml and http://www.javascriptkit.com/jsref/select.shtml#section2.

Author Ivan ZugecPosted on August 3, 2008May 2, 2016Categories Uncategorized

Post navigation

Previous Previous post: Using zip via ssh
Next Next post: Helpful PHP array functions
  • LinkedIn
  • X
  • YouTube
  • Bluesky
  • GitHub
  • Twitch
  • TikTok

Recent Posts

  • Google Workspace CLI
  • Too much Video Data
  • Claude Code has new “Would you like to proceed?” Option
  • Got Access to Claude Cowork
  • AI Generated Ads

Archives

  • WebWash (Drupal tutorials)
  • Contact
  • Instagram
  • Twitter
  • LinkedIn
  • GitHub
  • YouTube
Ivan Zugec Proudly powered by WordPress