The query results of the html tag select are displayed in the drop-down menu of the html select drop-down menu, for example
Value 1 Value 2 Value 3
Now the result of my query from the database is 2. how can I automatically lock the drop-down menu in "value 2" when the page is displayed?
Reply to discussion (solution)
Value 1 Value 2 Value 3
$ Value = 2;
Echo "script document. getElementById ('name'). value = $ value script";
Value 1 Value 2 Value 3
$ Value = 2;
Echo "script" docu ......
Great. problem solving
MaleFemale
$ Value = $ list ['sex']; echo "script document. getElementById ('sex'). value = $ value script";
Is there any error in this place? Never
MaleFemale
This post was last edited by xuzuning at 11:51:14 on
PHP code? 12345MaleFemale A string is enclosed by quotation marks. variables are generated without quotation marks (js) As it turns out, there is not much knowledge about js. Thank you for your advice.