Skip to content

WiserBit

Digital solutions for end users and developers.

Subjects

  • Announcements (5)
  • Bash Scripts (4)
  • Blog (1)
  • Domains (2)
  • HTML (4)
  • Java Script (2)
  • PHP (1)
  • Visual Studio (6)
  • Web Development (8)
  • WordPress (1)

Topics

  • #Free Web To App
  • Alexa
  • Android SDK 30
  • C#
  • Convert Website To App
  • Debian
  • Domains
  • Edge
  • Favicon
  • HTML
  • iOS SDK 12.2
  • JS
  • LAMP
  • Linux
  • Password
  • Sublime Text 3
  • Sudo
  • Top 1 Million
  • VB
  • Visual Studio
  • VPS
  • Web Development
  • Webhosting
  • Webmin
  • Web To APP
  • Webview App

Menu

  • About

Tag: HTML

Loop through all the options in select HTML using JS

In some cases you need to loop thru all options in the select HTML component. This code demonstrate how to do it:

 


var select = document.getElementById("Market");

for(i = 0; i < select.options.length; i++)
{
    //Display the option value
    console.log(select.options[i].value);

    //Display the option text
    console.log(select.options[i].text);
}

Posted on November 5, 2017July 8, 2021Author WiserBitCategories HTML, Java ScriptTags HTML, JS
Proudly powered by WordPress