Tag:Get the select value

  • A complete example of how JavaScript obtains select values


    This article illustrates how JavaScript obtains select values. Share for your reference, as follows: <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <title> www.jb51.net JavaScript gets select value </title> </head> <script> // JavaScript gets the selected value /* Var obj = document. getElementById (“testSelect”); //positioning ID Var index = obj. selectedIndex; //Selected index Var text = […]