Die Beispiele in diesem Artikel teilen Ihnen den spezifischen Code mit, der auf den Text von JS klickt, um ihn automatisch im Dropdown-Feld für Ihre Referenz zu finden. Der spezifische Inhalt ist wie folgt
<html> <head runat = "server"> <title> </title> <style type = "text/css"> #sitestat {width: 97px; Höhe: 181px; } </style> </head> <body> <from> <script Language = javaScript> Funktion foo () {// var i = 3; var i = document.getElementById ("ds"). Wert; o = document.getElementById ("Sitestat"); für (c = 0; c <o.Length; c ++) {dy = o.options [c] .Value.indexof (i) if (dy == 0) // if (o.options [c] .Value == i) {O.Options [c] .Selected = true; brechen; } } } }</script> <select name="SiteStat" multiple="multiple" id="SiteStat"> <option value="-1" selected></option> <option value="1" >Status A</option> <option value="0">Status B</option> <option value="22">Status C</option> <option value="33">Status D</option></select></from><input type = 'text' name = 'olala' id = 'ds'/> <Eingabe type = 'sure' name = 'sub' value = 'query display' onclick = "foo ()"/> </body> </html>Das obige dreht sich alles um diesen Artikel, und ich hoffe, dass es für alle hilfreich sein wird, JavaScript -Programme zu lernen.